Skip to content

Commit

Permalink
[Cache] Accessing undefined constants raises an Error in php8
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed May 23, 2020
1 parent 2799d55 commit 0feeb9e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Expand Up @@ -66,8 +66,14 @@ public function testOptions()
*/
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]);
}

Expand Down
10 changes: 8 additions & 2 deletions src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php
Expand Up @@ -76,8 +76,14 @@ public function testOptions()
*/
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]);
}

Expand Down

0 comments on commit 0feeb9e

Please sign in to comment.