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