[Cache] Accessing undefined constants raises an Error in php8

This commit is contained in:
Alexander M. Turek 2020-05-23 11:54:14 +02:00
parent 2799d559f3
commit 49fd0efb12
2 changed files with 16 additions and 4 deletions

View File

@ -66,8 +66,14 @@ class MemcachedAdapterTest extends AdapterTestCase
*/
public function testBadOptions($name, $value)
{
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
if (\PHP_VERSION_ID < 80000) {
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
} else {
$this->expectException('Error');
$this->expectExceptionMessage('Undefined class constant \'Memcached::');
}
MemcachedAdapter::createConnection([], [$name => $value]);
}

View File

@ -76,8 +76,14 @@ class MemcachedCacheTest extends CacheTestCase
*/
public function testBadOptions($name, $value)
{
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
if (\PHP_VERSION_ID < 80000) {
$this->expectException('ErrorException');
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
} else {
$this->expectException('Error');
$this->expectExceptionMessage('Undefined class constant \'Memcached::');
}
MemcachedCache::createConnection([], [$name => $value]);
}