Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
#6615 - less fragile test, as implemented interfaces number may vary …
Browse files Browse the repository at this point in the history
…greatly depending on interface/class inheritance
  • Loading branch information
Ocramius committed Nov 22, 2014
1 parent adb3b8c commit a2bd06e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/ZendTest/Mvc/Controller/AbstractControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public function testSetEventManagerWithDefaultIdentifiers()
/* @var $eventManager \Zend\EventManager\EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
$eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface');

$eventManager->expects($this->once())->method('setIdentifiers')->with($this->countOf(4));
$eventManager
->expects($this->once())
->method('setIdentifiers')
->with($this->logicalNot($this->contains('customEventIdentifier')));

$this->controller->setEventManager($eventManager);
}
Expand All @@ -51,10 +54,7 @@ public function testSetEventManagerWithCustomStringIdentifier()
/* @var $eventManager \Zend\EventManager\EventManagerInterface|\PHPUnit_Framework_MockObject_MockObject */
$eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface');

$eventManager->expects($this->once())->method('setIdentifiers')->with($this->logicalAnd(
$this->countOf(5),
$this->contains('customEventIdentifier')
));
$eventManager->expects($this->once())->method('setIdentifiers')->with($this->contains('customEventIdentifier'));

$reflection = new ReflectionProperty($this->controller, 'eventIdentifier');

Expand All @@ -73,7 +73,6 @@ public function testSetEventManagerWithMultipleCustomStringIdentifier()
$eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface');

$eventManager->expects($this->once())->method('setIdentifiers')->with($this->logicalAnd(
$this->countOf(6),
$this->contains('customEventIdentifier1'),
$this->contains('customEventIdentifier2')
));
Expand Down

0 comments on commit a2bd06e

Please sign in to comment.