Skip to content
Permalink
Browse files

Renaming some methods to access the event list.

  • Loading branch information...
burzum committed May 31, 2016
1 parent 75a9863 commit 2004d5a1f781ba4ada5772b3ad06fce253eb7558
Showing with 9 additions and 9 deletions.
  1. +3 −3 src/Event/EventManager.php
  2. +6 −6 tests/TestCase/Event/EventManagerTest.php
@@ -486,7 +486,7 @@ public function matchingListeners($eventKeyPattern)
*
* @return array
*/
public function eventList()
public function getEventList()
{
return $this->_eventList;
}
@@ -521,7 +521,7 @@ public function listEvents($enabled)
* @param \Cake\Event\EventList $eventList The event stack object to use.
* @return void
*/
public function attachEventList(EventList $eventList)
public function setEventList(EventList $eventList)
{
$this->_eventList = $eventList;
$this->_listEvents = true;
@@ -532,7 +532,7 @@ public function attachEventList(EventList $eventList)
*
* @return void
*/
public function detachEventList()
public function unsetEventList()
{
$this->_eventList = null;
$this->_listEvents = false;
@@ -726,25 +726,25 @@ public function testGetDispatchedEvents()
$event2 = new Event('my_second_event', $this);
$manager = new EventManager();
$manager->attachEventList($eventList);
$manager->setEventList($eventList);
$manager->dispatch($event);
$manager->dispatch($event2);
$result = $manager->eventList();
$result = $manager->getEventList();
$this->assertInstanceOf('\Cake\Event\EventList', $result);
$this->assertCount(2, $result);
$this->assertEquals($result[0], $event);
$this->assertEquals($result[1], $event2);
$manager->eventList()->flush();
$result = $manager->eventList();
$manager->getEventList()->flush();
$result = $manager->getEventList();
$this->assertCount(0, $result);
$manager->detachEventList();
$manager->unsetEventList();
$manager->dispatch($event);
$manager->dispatch($event2);
$result = $manager->eventList();
$result = $manager->getEventList();
$this->assertNull($result);
}
}

0 comments on commit 2004d5a

Please sign in to comment.
You can’t perform that action at this time.