コード例 #1
0
ファイル: Identifier.php プロジェクト: kaihempel/identifier
 /**
  * Checks in current instance is representing the given value
  *
  * @param   integer $id
  * @return  boolean
  * @throws  IdentifierException
  */
 public function is($id)
 {
     if (!is_int($id)) {
         throw IdentifierException::make('Only integer values allowed!');
     }
     return $this->id == $id;
 }
コード例 #2
0
 public function testMake()
 {
     $ex = IdentifierException::make();
     $this->assertInstanceOf('Identifier\\Exception\\IdentifierException', $ex);
     $this->assertEquals('Unknown exception', $ex->getMessage());
 }