Skip to content

Commit

Permalink
Apply setEventManager() in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Pustułka committed Apr 21, 2017
1 parent a95249a commit 2172466
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/TestCase/Controller/ComponentRegistryTest.php
Expand Up @@ -112,7 +112,7 @@ public function testLoadWithEnableFalse()
$mock->expects($this->never())
->method('attach');

$this->Components->getController()->eventManager($mock);
$this->Components->getController()->setEventManager($mock);

$result = $this->Components->load('Cookie', ['enabled' => false]);
$this->assertInstanceOf('Cake\Controller\Component\CookieComponent', $result);
Expand Down
6 changes: 3 additions & 3 deletions tests/TestCase/Controller/ComponentTest.php
Expand Up @@ -81,7 +81,7 @@ public function testInnerComponentsAreNotEnabled()
{
$mock = $this->getMockBuilder(EventManager::class)->getMock();
$controller = new Controller();
$controller->eventManager($mock);
$controller->setEventManager($mock);

$mock->expects($this->once())
->method('on')
Expand Down Expand Up @@ -243,7 +243,7 @@ public function testEventsInnerComponent()
->with($this->isInstanceOf(AppleComponent::class));

$controller = new Controller();
$controller->eventManager($eventManager);
$controller->setEventManager($eventManager);

$Collection = new ComponentRegistry($controller);

Expand All @@ -262,7 +262,7 @@ public function testNoEventsInnerComponent()
$eventManager->expects($this->never())->method('on');

$controller = new Controller();
$controller->eventManager($eventManager);
$controller->setEventManager($eventManager);

$Collection = new ComponentRegistry($controller);

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Event/EventDispatcherTraitTest.php
Expand Up @@ -60,7 +60,7 @@ public function testSettingEventManager()
{
$eventManager = new EventManager();

$this->subject->eventManager($eventManager);
$this->subject->setEventManager($eventManager);

$this->assertSame($eventManager, $this->subject->getEventManager());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/HelperTest.php
Expand Up @@ -125,7 +125,7 @@ public function testThatHelperHelpersAreNotAttached()
Plugin::loadAll();

$events = $this->getMockBuilder('\Cake\Event\EventManager')->getMock();
$this->View->eventManager($events);
$this->View->setEventManager($events);

$events->expects($this->never())
->method('attach');
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/View/ViewTest.php
Expand Up @@ -1155,7 +1155,7 @@ public function testHelperCallbackTriggering()
$View->templatePath($this->PostsController->name);

$manager = $this->getMockBuilder('Cake\Event\EventManager')->getMock();
$View->eventManager($manager);
$View->setEventManager($manager);

$manager->expects($this->at(0))->method('dispatch')
->with(
Expand Down

0 comments on commit 2172466

Please sign in to comment.