public function isAllowed(Name $name, Code $code) { if (is_array($this->only)) { if (in_array($name->getAbbreviation()->getAbbr(), $this->only) == false) { return false; } } if (is_array($this->not)) { if (in_array($name->getAbbreviation()->getAbbr(), $this->not)) { return false; } } return true; }
public function testGetAbbreviation() { $abbr = new Abbreviation('г'); $name = new Name('Город', $abbr); $this->assertEquals($abbr, $name->getAbbreviation()); }