Skip to content

Commit

Permalink
Test dispatcher builds all common logic objects in tree hierarchy.
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 31, 2014
1 parent b7ae3d0 commit 9d57a35
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
6 changes: 5 additions & 1 deletion test/Unit/Dispatcher/PageDispatcher.test.php
Expand Up @@ -24,9 +24,13 @@ public function setUp() {

$cfg = new \Gt\Core\ConfigObj();

$this->request = $this->getMock("\Gt\Request\Request", null, [
$this->request = $this->getMock("\Gt\Request\Request", ["getType"], [
"/", $cfg,
]);
$this->request->expects($this->any())
->method("getType")
->will($this->returnValue(\Gt\Request\Request::TYPE_PAGE)
);
$this->response = $this->getMock("\Gt\Response\Reponse", null);
$this->apiFactory = $this->getMock("\Gt\Api\ApiFactory", null, [
$cfg
Expand Down
11 changes: 7 additions & 4 deletions test/Unit/Logic/LogicFactory.test.php
Expand Up @@ -58,10 +58,13 @@ public function testGetLogicFileArrayGivesCommons($uri) {
$topPath
);

$directory = dirname($topPath . $uri);
$commonPath = $directory . "/_common.php";

$this->assertContains($commonPath, $logicFileArray);
// Check each directory in the tree.
$directory = $topPath . $uri;
do {
$directory = dirname($directory);
$commonPath = $directory . "/_common.php";
$this->assertContains($commonPath, $logicFileArray);
} while(strstr($directory, $path));
}

/**
Expand Down

0 comments on commit 9d57a35

Please sign in to comment.