/** * Test the bindObject without array option */ public function testBindObject() { $this->_owner = new Mock\Owner(); $this->_owner->name = 'Sam'; $this->_owner->age = 25; $query = PDOFactory::Get("INSERT INTO owners (name, age) VALUES (:name, :age)"); $query->bindObject($this->_owner); $query->execute(); $this->_owner->id = PDOFactory::LastInsertId(); $owner = Mock\Owner::Find($this->_owner->id); $this->assertEquals('Sam', $owner->name); }
public function testFindAllWithLimit() { $owners = Mock\Owner::FindAll(array('limit' => 2)); $this->assertEquals(2, count($owners)); $moreOwners = Mock\Owner::FindAll(array('limit' => 2, 'offset' => 2)); $this->assertNotEquals($owners[0]->id(), $moreOwners[0]->id()); $this->assertGreaterThan(1, count($moreOwners)); }