public function testPatch() { $pdo = $this->createPDO(); $pdoStatement = $this->createPDOStatement(); $connection = $this->createConnection($pdo); $statement = 'some sql statement'; $returnInfo = ['info in an array']; $pdo->expects($this->once())->method('prepare')->with($this->equalTo($statement))->will($this->returnValue($pdoStatement)); $pdoStatement->expects($this->once())->method('execute'); $pdoStatement->expects($this->once())->method('errorInfo')->will($this->returnValue($returnInfo)); $query = new Query($connection); $this->assertEquals($returnInfo, $query->patch($statement)); }