Skip to content

Commit 03ab745

Browse files
SvenRtbgcweiske
authored andcommitted
Fix expected exception message
Was never verified using the non-existing second parameter of expectException()
1 parent 16f6d80 commit 03ab745

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/UnionTypesTest.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ class UnionTypesTest extends \PHPUnit\Framework\TestCase
1717
*/
1818
public function testMapUnionNative()
1919
{
20-
$this->expectException(
21-
JsonMapper_Exception::class,
22-
'Cannot decide which of the union types shall be used: \DateTime|string'
23-
);
20+
$this->expectException(JsonMapper_Exception::class);
21+
$this->expectExceptionMessage('Cannot decide which of the union types shall be used: \DateTime|string');
22+
2423
$jm = new JsonMapper();
2524
$sn = $jm->map(
2625
json_decode('{"dateOrStringNative":"stringvalue"}'),
@@ -33,10 +32,9 @@ public function testMapUnionNative()
3332
*/
3433
public function testMapUnionDocblock()
3534
{
36-
$this->expectException(
37-
JsonMapper_Exception::class,
38-
'Cannot decide which of the union types shall be used: \DateTime|string'
39-
);
35+
$this->expectException(JsonMapper_Exception::class);
36+
$this->expectExceptionMessage('Cannot decide which of the union types shall be used: DateTime|string');
37+
4038
$jm = new JsonMapper();
4139
$sn = $jm->map(
4240
json_decode('{"dateOrStringDocblock":"stringvalue"}'),

0 commit comments

Comments
 (0)