示例#1
0
文件: CrudTest.php 项目: phlib/db
 /**
  * @dataProvider deleteDataProvider
  */
 public function testDelete($expectedSql, $table, $where, $bind)
 {
     $executeArgs = is_null($bind) ? [] : $bind;
     // Returned stmt will have rowCount called
     $pdoStatement = $this->getMock('\\PDOStatement');
     $pdoStatement->expects($this->once())->method('rowCount');
     // Query should be called with the SQL and bind
     $this->adapter->expects($this->once())->method('query')->with($expectedSql, $executeArgs)->will($this->returnValue($pdoStatement));
     $result = !is_null($where) ? !is_null($bind) ? $this->crud->delete($table, $where, $bind) : $this->crud->delete($table, $where) : $this->crud->delete($table);
 }
示例#2
0
文件: Adapter.php 项目: phlib/db
 /**
  * @param string $table
  * @param string $where
  * @param array $bind
  * @return int
  */
 public function delete($table, $where = '', array $bind = array())
 {
     return $this->crud->delete($table, $where, $bind);
 }