Skip to content

Commit

Permalink
Merge fcc966c into dca4c37
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire committed Nov 10, 2016
2 parents dca4c37 + fcc966c commit 3c1b37f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Controller/SitemapsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ public function index() {
}

$this->set('data', $data);
$this->set('_serialize', false);
}
}
16 changes: 14 additions & 2 deletions tests/TestCase/Controller/SitemapsControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ public function testIndexNoModels() {
'\Sitemap\Controller\SitemapsController',
['set']
);
$Controller->expects($this->once())

$Controller->expects($this->at(0))
->method('set')
->with('data', [])
->will($this->returnValue(true));

$Controller->expects($this->at(1))
->method('set')
->with('_serialize', false)
->will($this->returnValue(true));

$Controller->index();
}

Expand All @@ -89,11 +95,17 @@ public function testIndexWithModels() {
'\Sitemap\Controller\SitemapsController',
['set', 'loadModel']
);
$Controller->expects($this->once())

$Controller->expects($this->at(1))
->method('set')
->with('data', ['Pages' => $pagesFindQuery])
->will($this->returnValue(true));

$Controller->expects($this->at(2))
->method('set')
->with('_serialize', false)
->will($this->returnValue(true));

$Controller->expects($this->once())
->method('loadModel')
->with('Pages')
Expand Down

0 comments on commit 3c1b37f

Please sign in to comment.