예제 #1
0
파일: Oid.php 프로젝트: squareproton/bond
 /**
  * Represents a database oid. This number specific to a database, hence the reference to Pg
  * @param int Oid
  * @param Bond\Pg
  */
 public function __construct($oid, Pg $pg)
 {
     if (!\Bond\is_intish($oid)) {
         throw new BadTypeException($input, 'int');
     }
     $this->oid = (int) $oid;
     $this->pg = $pg;
 }
예제 #2
0
 public function testIsIntIsh()
 {
     $this->assertFalse(\Bond\is_intish("1.0"));
     $this->assertTrue(\Bond\is_intish(1));
     $this->assertTrue(\Bond\is_intish("1"));
     $this->assertFalse(\Bond\is_intish(" 1"));
     $this->assertFalse(\Bond\is_intish(null));
     $this->assertFalse(\Bond\is_intish(""));
 }