/** * @covers Zend\Db\Sql\Insert::prepareStatement */ public function testPrepareStatement() { $mockDriver = $this->getMock('Zend\\Db\\Adapter\\Driver\\DriverInterface'); $mockDriver->expects($this->any())->method('getPrepareType')->will($this->returnValue('positional')); $mockDriver->expects($this->any())->method('formatParameterName')->will($this->returnValue('?')); $mockAdapter = $this->getMock('Zend\\Db\\Adapter\\Adapter', null, array($mockDriver)); $mockStatement = $this->getMock('Zend\\Db\\Adapter\\Driver\\StatementInterface'); $pContainer = new \Zend\Db\Adapter\ParameterContainer(array()); $mockStatement->expects($this->any())->method('getParameterContainer')->will($this->returnValue($pContainer)); $mockStatement->expects($this->at(1))->method('setSql')->with($this->equalTo('INSERT INTO "foo" ("bar") VALUES (?)')); $this->insert->into('foo')->values(array('bar' => 'baz')); $this->insert->prepareStatement($mockAdapter, $mockStatement); }