Content-Length: 314849 | pFad | http://github.com/symfony/cache/commit/7f4c36a0af452eee316eaea283169d1e4c9865a1

E6 bug #36917 [Cache] Accessing undefined constants raises an Error in p… · symfony/cache@7f4c36a · GitHub
Skip to content

Commit 7f4c36a

Browse files
bug #36917 [Cache] Accessing undefined constants raises an Error in php8 (derrabus)
This PR was merged into the 3.4 branch. Discussion ---------- [Cache] Accessing undefined constants raises an Error in php8 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #36872 | License | MIT | Doc PR | N/A Calling `constant()` for an undefined constant will raise an `Error` on php 8. This PR adjust the Memcached tests to this new behavior. Commits ------- 49fd0efb12 [Cache] Accessing undefined constants raises an Error in php8
2 parents 0005485 + aa06c02 commit 7f4c36a

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Diff for: Tests/Adapter/MemcachedAdapterTest.php

+8-2
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

Diff for: Tests/Simple/MemcachedCacheTest.php

+8-2
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/symfony/cache/commit/7f4c36a0af452eee316eaea283169d1e4c9865a1

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy