示例#1
0
文件: Event.php 项目: evaneos/berthe
 /**
  * They're equal if this is the same type of event and the same id
  * Allows to know if an event concerns a same type of action on the same object.
  * Very useful to delete doubles.
  *
  * @param  Event $event
  * @return boolean
  */
 public function isEqual(Event $event)
 {
     try {
         return $this->getName() === $event->getName() && $this->get('id') === $event->get('id') && self::getSortedKeys($this->getParameters()) === self::getSortedKeys($event->getParameters());
     } catch (\Exception $e) {
     }
     return false;
 }
示例#2
0
 /**
  * @test
  */
 public function it_should_return_the_array_of_all_params()
 {
     $event = new Event('eventName', array('aKey' => 'something'));
     $this->assertEquals(array('aKey' => 'something'), $event->getParameters());
 }