Example #1
0
 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;
 }
Example #2
0
 public function testGetAbbreviation()
 {
     $abbr = new Abbreviation('г');
     $name = new Name('Город', $abbr);
     $this->assertEquals($abbr, $name->getAbbreviation());
 }