/** * * TODO use filter instead * * @param Event $event * @param array $restrictions * @return boolean */ public static function checkRestriction(Event $event, $restrictions) { $properties = $event->getProperties(); if (is_array($restrictions)) { foreach ($restrictions as $property_name => $restriction) { if ($restriction != '') { if ($properties[strtoupper($property_name)] != $restriction) { return false; } } } return true; } return true; }
/** * @covers Phossa\Event\Event::setProperties */ public function testSetProperties() { $a = ['a' => 'aa', 'b' => 'bb']; $this->object->setProperties($a); $this->assertTrue($a === $this->object->getProperties()); }