diff --git a/src/Dispatcher/Dispatcher.php b/src/Dispatcher/Dispatcher.php index dd711688..93ca6d9b 100644 --- a/src/Dispatcher/Dispatcher.php +++ b/src/Dispatcher/Dispatcher.php @@ -19,8 +19,7 @@ abstract class Dispatcher { private $apiFactory; private $dbFactory; -public function __construct(Request $request, Response $response, -ApiFactory $apiFactory, DatabaseFactory $dbFactory) { +public function __construct($request, $response, $apiFactory, $dbFactory) { $this->request = $request; $this->response = $response; $this->apiFactory = $apiFactory; diff --git a/test/Unit/Dispatcher/PageDispatcher.test.php b/test/Unit/Dispatcher/PageDispatcher.test.php index af46cb03..1f25c0fb 100644 --- a/test/Unit/Dispatcher/PageDispatcher.test.php +++ b/test/Unit/Dispatcher/PageDispatcher.test.php @@ -8,16 +8,31 @@ class PageDispatcher_Test extends \PHPUnit_Framework_TestCase { -public function testTest() { - $request = $this->getMock("\Gt\Request\Request"); - $response = $this->getMock("\Gt\Response\Reponse"); - $apiFactory = $this->getMock("\Gt\Api\ApiFactory"); - $dbFactory = $this->getMock("\Gt\Database\DatabaseFactory"); +private $dispatcher; - $dispatcher = new PageDispatcher( +public function setUp() { + $cfg = new \Gt\Core\ConfigObj(); + + $request = $this->getMock("\Gt\Request\Request", null, [ + "/", $cfg, + ]); + $response = $this->getMock("\Gt\Response\Reponse", null);/*, [ + $cfg + ]);*/ + $apiFactory = $this->getMock("\Gt\Api\ApiFactory", null, [ + $cfg + ]); + $dbFactory = $this->getMock("\Gt\Database\DatabaseFactory", null, [ + $cfg + ]); + + $this->dispatcher = new PageDispatcher( $request, $response, $apiFactory, $dbFactory); +} - $this->assertTrue(true); +public function testDispatcherCreated() { + $this->assertInstanceOf("\Gt\Dispatcher\PageDispatcher", + $this->dispatcher); } }# \ No newline at end of file