Esempio n. 1
0
 public function testInsertRecords()
 {
     $data = [['column1' => 'value1'], ['column1' => 'value2']];
     $pdoMock = $this->getMock('\\PdoTest', ['prepare', 'execute'], [], '', false);
     $pdoMock->expects($this->any())->method('prepare')->willReturnSelf();
     $pdoMock->expects($this->any())->method('execute')->willReturnSelf();
     $this->pdoMysql->expects($this->any())->method('getConnection')->willReturn($pdoMock);
     $this->assertEquals(2, $this->adapterMysql->insertRecords('some_table', $data));
 }
 public function testInsertRecords()
 {
     $data = [['column1' => 'value1'], ['column1' => 'value2']];
     $this->pdoMysql->expects($this->any())->method('insertMultiple')->with($this->equalTo('some_table'), $this->equalTo($data))->willReturn(2);
     $this->assertEquals(2, $this->adapterMysql->insertRecords('some_table', $data));
 }