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 0feeb9e

Browse filesBrowse files
committed
[Cache] Accessing undefined constants raises an Error in php8
1 parent 2799d55 commit 0feeb9e
Copy full SHA for 0feeb9e

File tree

2 files changed

+16
-4
lines changed
Filter options

2 files changed

+16
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Adapter/MemcachedAdapterTest.php
+8-2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Tests/Simple/MemcachedCacheTest.php
+8-2Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.