8000 [Cache] Accessing undefined constants raises an Error in php8 · symfony/symfony@49fd0ef · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49fd0ef

Browse files
committed
[Cache] Accessing undefined constants raises an Error in php8
1 parent 2799d55 commit 49fd0ef

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ public function testOptions()
6666
*/
6767
public function testBadOptions($name, $value)
6868
{
69-
$this->expectException('ErrorException');
70-
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
69+
if (\PHP_VERSION_ID < 80000) {
70+
$this->expectException('ErrorException');
71+
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
72+
} else {
73+
$this->expectException('Error');
74+
$this->expectExceptionMessage('Undefined class constant \'Memcached::');
75+
}
76+
7177
MemcachedAdapter::createConnection([], [$name => $value]);
7278
}
7379

src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,14 @@ public function testOptions()
7676
*/
7777
public function testBadOptions($name, $value)
7878
{
79-
$this->expectException('ErrorException');
80-
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
79+
if (\PHP_VERSION_ID < 80000) {
80+
$this->expectException('ErrorException');
81+
$this->expectExceptionMessage('constant(): Couldn\'t find constant Memcached::');
82+
} else {
83+
$this->expectException('Error');
84+
$this->expectExceptionMessage('Undefined class constant \'Memcached::');
85+
}
86+
8187
MemcachedCache::createConnection([], [$name => $value]);
8288
}
8389

0 commit comments

Comments
 (0)
0