示例#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
 public function testGetNameReturnsEventName()
 {
     $event = new Event('eventName');
     $this->assertEquals('eventName', $event->getName());
 }