Skip to content

Commit

Permalink
Begin PageDispatcher tests
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 6, 2014
1 parent 4b08e69 commit 9a0bb68
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/Dispatcher/Dispatcher.php
Expand Up @@ -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;
Expand Down
29 changes: 22 additions & 7 deletions test/Unit/Dispatcher/PageDispatcher.test.php
Expand Up @@ -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);
}

}#

0 comments on commit 9a0bb68

Please sign in to comment.