Commit d766fb4a authored by Ryan Weaver's avatar Ryan Weaver

Re-working test to use reflection and simply check that the _conn property has be nullified

parent 7d9c7c29
......@@ -403,11 +403,20 @@ SQLSTATE[HY000]: General error: 1 near \"MUUHAAAAHAAAA\"");
public function testConnectionIsClosed()
{
// set the internal _conn to some value
$reflection = new \ReflectionObject($this->_conn);
$connProperty = $reflection->getProperty('_conn');
$connProperty->setAccessible(true);
$connProperty->setValue($this->_conn, new \stdClass);
$connValue = $connProperty->getValue($this->_conn);
$this->assertInstanceOf('stdClass', $connValue);
// close the connection
$this->_conn->close();
//$this->setExpectedException('Doctrine\\DBAL\\Exception\\DriverException');
$this->_conn->quoteIdentifier('Bug');
// make sure the _conn has be set to null (but not unset)
$connNewValue = $connProperty->getValue($this->_conn);
$this->assertNull($connNewValue, 'Connection can\'t be closed.');
}
public function testFetchAll()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment