Browse Source

Apply setEventManager() in tests.

Robert Pustułka 9 years ago
parent
commit
2172466db1

+ 1 - 1
tests/TestCase/Controller/ComponentRegistryTest.php

@@ -112,7 +112,7 @@ class ComponentRegistryTest extends TestCase
         $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);

+ 3 - 3
tests/TestCase/Controller/ComponentTest.php

@@ -81,7 +81,7 @@ class ComponentTest extends TestCase
     {
         $mock = $this->getMockBuilder(EventManager::class)->getMock();
         $controller = new Controller();
-        $controller->eventManager($mock);
+        $controller->setEventManager($mock);
 
         $mock->expects($this->once())
             ->method('on')
@@ -243,7 +243,7 @@ class ComponentTest extends TestCase
             ->with($this->isInstanceOf(AppleComponent::class));
 
         $controller = new Controller();
-        $controller->eventManager($eventManager);
+        $controller->setEventManager($eventManager);
 
         $Collection = new ComponentRegistry($controller);
 
@@ -262,7 +262,7 @@ class ComponentTest extends TestCase
         $eventManager->expects($this->never())->method('on');
 
         $controller = new Controller();
-        $controller->eventManager($eventManager);
+        $controller->setEventManager($eventManager);
 
         $Collection = new ComponentRegistry($controller);
 

+ 1 - 1
tests/TestCase/Event/EventDispatcherTraitTest.php

@@ -60,7 +60,7 @@ class EventDispatcherTraitTest extends TestCase
     {
         $eventManager = new EventManager();
 
-        $this->subject->eventManager($eventManager);
+        $this->subject->setEventManager($eventManager);
 
         $this->assertSame($eventManager, $this->subject->getEventManager());
     }

+ 1 - 1
tests/TestCase/View/HelperTest.php

@@ -125,7 +125,7 @@ class HelperTest extends TestCase
         Plugin::loadAll();
 
         $events = $this->getMockBuilder('\Cake\Event\EventManager')->getMock();
-        $this->View->eventManager($events);
+        $this->View->setEventManager($events);
 
         $events->expects($this->never())
             ->method('attach');

+ 1 - 1
tests/TestCase/View/ViewTest.php

@@ -1155,7 +1155,7 @@ class ViewTest extends TestCase
         $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(