Skip to content

Commit

Permalink
Fixing tests where objects were not added to the mockObjects lists, m…
Browse files Browse the repository at this point in the history
…aking their expects() not count.
  • Loading branch information
markstory committed Sep 15, 2010
1 parent 8e97a5e commit 5d697b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cake/tests/cases/libs/view/helper_collection.test.php
Expand Up @@ -129,10 +129,12 @@ function testTrigger() {
$this->Helpers->load('TriggerMockHtml');
$this->Helpers->load('TriggerMockForm');

$this->Helpers->TriggerMockForm->expects($this->once())->method('beforeRender')
$this->Helpers->TriggerMockHtml->expects($this->once())->method('beforeRender')
->with('one', 'two');
$this->Helpers->TriggerMockForm->expects($this->once())->method('beforeRender')
->with('one', 'two');

$this->mockObjects[] = $this->Helpers->TriggerMockForm;

$this->assertTrue($this->Helpers->trigger('beforeRender', array('one', 'two')));
}
Expand All @@ -155,6 +157,9 @@ function testTriggerWithDisabledHelpers() {
->with('one', 'two');
$this->Helpers->TriggerMockForm->expects($this->never())->method('beforeRender');

$this->mockObjects[] = $this->Helpers->TriggerMockForm;
$this->mockObjects[] = $this->Helpers->TriggerMockHtml;

$this->Helpers->disable('TriggerMockForm');

$this->assertTrue($this->Helpers->trigger('beforeRender', array('one', 'two')));
Expand Down

0 comments on commit 5d697b9

Please sign in to comment.