/** * 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; }
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("")); }