Skip to content

Commit

Permalink
#2407 - Unify test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Sep 10, 2023
1 parent d47a5aa commit 4779eea
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions tests/Extension/Interfaces/InterfaceMethodSignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,17 @@ public function testImplementInterfaceInMethodSignature(): void
public function testImplementInterfaceInMethodSignatureInt(): void
{
$this->expectException(\TypeError::class);
if (version_compare(PHP_VERSION, '8.3.0beta3', '>=')) {
$this->expectExceptionMessageMatches('/must be of type int, true given/');
} else {
$this->expectExceptionMessageMatches('/must be of (the\s)?type int, bool given/');
}
$this->expectExceptionMessageMatches('/must be of type int, (true|bool) given/');

(new ImplementInt())->set(true);
}

public function testImplementInterfaceInMethodSignatureInterface(): void
{
$this->expectException(\TypeError::class);
if (version_compare(PHP_VERSION, '8.3.0beta3', '>=')) {
$this->expectExceptionMessageMatches(
'/(must be of type) Stub\\\\Interfaces\\\\InterfaceInt, true given/'
);
} else {
$this->expectExceptionMessageMatches(
'/(must be of type|implement interface) Stub\\\\Interfaces\\\\InterfaceInt, bool given/'
);
}
$this->expectExceptionMessageMatches(
'/(must be of type) Stub\\\\Interfaces\\\\InterfaceInt, (true|bool) given/'
);

(new ImplementInterface())->getVoid(true);
}
Expand Down

0 comments on commit 4779eea

Please sign in to comment.