mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 18:50:11 +02:00
tests for CoR
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
namespace DesignPatterns\Tests\ChainOfResponsibilities;
|
namespace DesignPatterns\Tests\ChainOfResponsibilities;
|
||||||
|
|
||||||
use DesignPatterns\ChainOfResponsibilities\Request;
|
use DesignPatterns\ChainOfResponsibilities\Request;
|
||||||
|
use DesignPatterns\ChainOfResponsibilities\Responsible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ChainTest tests the CoR
|
* ChainTest tests the CoR
|
||||||
@@ -14,9 +15,22 @@ use DesignPatterns\ChainOfResponsibilities\Request;
|
|||||||
class ChainTest extends \PHPUnit_Framework_TestCase
|
class ChainTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $chain;
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
$this->chain = new Responsible\FastStorage(array('bar' => 'baz'));
|
||||||
|
$this->chain->append(new Responsible\SlowStorage(array('bar' => 'baz', 'foo' => 'bar')));
|
||||||
|
}
|
||||||
|
|
||||||
public function testProcess()
|
public function testProcess()
|
||||||
{
|
{
|
||||||
|
$request = new Request();
|
||||||
|
$request->verb = 'get';
|
||||||
|
$request->key = 'bar';
|
||||||
|
|
||||||
|
$ret = $this->chain->handle($request);
|
||||||
|
print_r($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user