/** * Factory Insert Builder * * @param string $table the table to update * @return Insert */ public static function insert($table = null) { $query = new Insert(); if ($table) { $query->into($table); } return $query; }
public function testResolvesSqlReplacingPlaceholders() { $this->object->into('table_name')->values(array('name' => ':name', 'age' => ':age')); $sql = 'INSERT INTO table_name (name, age) VALUES ("foo", 18)'; $this->assertEquals($sql, $this->object->toSql(array('name' => 'foo', 'age' => 18))); }