/** * @covers Zend\Db\Adapter\Driver\Pdo\Statement::execute */ public function testExecute() { $this->statement->setDriver(new Pdo(new Connection($pdo = new TestAsset\SqliteMemoryPdo()))); $this->statement->initialize($pdo); $this->statement->prepare('SELECT 1'); $this->assertInstanceOf('Zend\\Db\\Adapter\\Driver\\Pdo\\Result', $this->statement->execute()); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->statement = new Statement(); $this->statement->setDriver($this->getMock('Zend\\Db\\Adapter\\Driver\\Pdo\\Pdo', array('createResult'), array(), '', false)); $this->statement->initialize(new TestAsset\CtorlessPdo($this->pdoStatementMock = $this->getMock('PDOStatement', array('execute', 'bindParam')))); }