Skip to content

Commit 303106f

Browse files
committed
test: fix assertion, because error message is different from PHP7 to PHP8
1 parent aae1708 commit 303106f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/ProtocolVersionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ public function testClone(): void
144144
$ipv4 = ProtocolVersion::ipv4();
145145

146146
$this->expectError();
147-
$this->expectErrorMessage(sprintf(
148-
'Call to private %s::__clone() from context \'%s\'',
149-
ProtocolVersion::class,
150-
self::class,
147+
$this->expectErrorMessageMatches(sprintf(
148+
'#^Call to private %s::__clone\(\) from (?:context|scope) \'?%s\'?$#',
149+
preg_quote(ProtocolVersion::class, '#'),
150+
preg_quote(self::class, '#'),
151151
));
152152
$cloned = clone $ipv4;
153153
}

0 commit comments

Comments
 (0)