public function testSetFetchMode() { $fetchMode = \PDO::FETCH_CLASS; $arg1 = 'MyClass'; $arg2 = array(1, 2); $this->wrappedStmt->expects($this->once())->method('setFetchMode')->with($fetchMode, $arg1, $arg2)->will($this->returnValue(true)); $this->assertAttributeSame(\PDO::FETCH_BOTH, 'defaultFetchMode', $this->stmt); $this->assertTrue($this->stmt->setFetchMode($fetchMode, $arg1, $arg2)); $this->assertAttributeSame($fetchMode, 'defaultFetchMode', $this->stmt); }
/** * {@inheritdoc} */ public function query() { $this->connect(); $stmt = call_user_func_array(array($this->_conn, 'query'), func_get_args()); $stmt = new Statement($stmt, $this); $stmt->setFetchMode($this->defaultFetchMode); return $stmt; }
/** * {@inheritdoc} */ public function query() { $this->connect(); $stmt = $this->_conn->query(...func_get_args()); $stmt = new Statement($stmt, $this); $stmt->setFetchMode($this->defaultFetchMode); return $stmt; }