/** * @covers Query_PDO_Driver::query * @todo Implement testQuery(). */ public function testQueryCount() { $query = $this->object->type('count')->table('fairies')->where('id', 8)->query(); $this->assertEquals("SELECT COUNT(*) as `count` FROM `fairies` WHERE `fairies`.`id` = ? ", current($query)); }
public function testQueryUpdateWithJoins() { $this->object->type('update')->data(array('p.name' => 'Tinkerbell'))->table('pixies', 'p')->join(array('forest', 'f'), array('p.forest_id', 'f.id'))->where('f.name', 'Dreamwood'); $this->assertEquals('UPDATE `pixies` AS `p` LEFT JOIN `forest` AS `f` ON `p`.`forest_id` = `f`.`id` SET `p.name` = ? WHERE `f`.`name` = ? ', current($this->object->query())); }