1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 09:34:54 +02:00

Fix all PHP 8.0 test failures

This commit is contained in:
Nick Liu
2020-11-27 17:00:32 +01:00
parent 072c1b3a90
commit f256b924ce
21 changed files with 103 additions and 34 deletions

View File

@@ -44,6 +44,14 @@ class e_db_mysqlTest extends e_db_abstractTest
);
}
public function _after()
{
$db_impl = $this->getDbImplementation();
if (@empty($db_impl->server_info)) return;
parent::_after();
}
public function testGetPDO()
{
$result = $this->db->getPDO();
@@ -71,4 +79,20 @@ class e_db_mysqlTest extends e_db_abstractTest
$result = $this->db->escape("Can't", true);
$this->assertEquals("Can\'t", $result);
}
public function testDb_Close()
{
$db_impl = $this->getDbImplementation();
$this->assertFalse(@empty($db_impl->server_info));
$this->db->db_Close();
$this->assertTrue(@empty($db_impl->server_info));
}
private function getDbImplementation()
{
$reflection_object = new ReflectionObject($this->db);
$db_property = $reflection_object->getProperty('mySQLaccess');
$db_property->setAccessible(true);
return $db_property->getValue($this->db);
}
}