/** * 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; }
public function testGetReturnsParamIfItWasSet() { $event = new Event('eventName', array('aKey' => 'something')); $this->assertEquals('something', $event->get('aKey')); }