/** * @covers Zend\Db\Adapter\Driver\Sqlsrv\Statement::prepare * @covers Zend\Db\Adapter\Driver\Sqlsrv\Statement::isPrepared */ public function testPrepare() { $sqlsrvResource = sqlsrv_connect($this->variables['hostname'], array('UID' => $this->variables['username'], 'PWD' => $this->variables['password'])); $statement = new Statement(); $statement->initialize($sqlsrvResource); $this->assertFalse($statement->isPrepared()); $this->assertSame($statement, $statement->prepare("SELECT 'foo'")); $this->assertTrue($statement->isPrepared()); unset($resource, $sqlsrvResource); }
/** * Register statement prototype * * @param Statement $statementPrototype * @return Sqlsrv */ public function registerStatementPrototype(Statement $statementPrototype) { $this->statementPrototype = $statementPrototype; $this->statementPrototype->setDriver($this); return $this; }
/** * @covers Zend\Db\Adapter\Driver\Sqlsrv\Statement::getParameterContainer * @todo Implement testGetParameterContainer(). */ public function testGetParameterContainer() { $container = new ParameterContainer(); $this->statement->setParameterContainer($container); $this->assertSame($container, $this->statement->getParameterContainer()); }