/** * @covers Zend\Db\TableGateway\TableGateway::insert */ public function testInsert() { $insert = $this->getMock('Zend\\Db\\Sql\\Insert'); // assert ? $insert->expects($this->once())->method('into')->with($this->table->getTableName()); $insert->expects($this->once())->method('prepareStatement')->with($this->mockAdapter); $insert->expects($this->once())->method('values')->with($this->equalTo(array('foo' => 'bar'))); $this->table->setSqlInsert($insert); $affectedRows = $this->table->insert(array('foo' => 'bar')); $this->assertEquals(5, $affectedRows); }