/** * @dataProvider insertDataProvider */ public function testInsert($expectedSql, $table, $data) { // Returned stmt will have rowCount called $pdoStatement = $this->getMock('\\PDOStatement'); $pdoStatement->expects($this->once())->method('rowCount')->will($this->returnValue(count($data))); $bind = array_values($data); $this->adapter->expects($this->any())->method('query')->with($expectedSql, $bind)->will($this->returnValue($pdoStatement)); $this->crud->insert($table, $data); }
/** * @param string $table * @param array $data * @return int */ public function insert($table, array $data) { return $this->crud->insert($table, $data); }