mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-05-30 18:39:38 +02:00
tests for CoR
This commit is contained in:
parent
b581aef8f2
commit
71a43e2e93
@ -7,6 +7,7 @@
|
||||
namespace DesignPatterns\Tests\ChainOfResponsibilities;
|
||||
|
||||
use DesignPatterns\ChainOfResponsibilities\Request;
|
||||
use DesignPatterns\ChainOfResponsibilities\Responsible;
|
||||
|
||||
/**
|
||||
* ChainTest tests the CoR
|
||||
@ -14,9 +15,22 @@ use DesignPatterns\ChainOfResponsibilities\Request;
|
||||
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()
|
||||
{
|
||||
|
||||
$request = new Request();
|
||||
$request->verb = 'get';
|
||||
$request->key = 'bar';
|
||||
|
||||
$ret = $this->chain->handle($request);
|
||||
print_r($request);
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user