Skip to content

Commit 34f49e1

Browse files
committed
Replaces deprecated PHPUnit features
1 parent 51ee5dc commit 34f49e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/Unit/Infrastructure/ResponseMapper/LegacyResponseMapperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,24 @@ public function it_should_return_decoded_body_on_ok()
4141

4242
/**
4343
* @test
44-
* @expectedException ApiErrorException
4544
*/
4645
public function it_should_return_error_on_ok_with_message_and_error()
4746
{
4847
$bodyWithMessageAndError = '{"message":"some message","error":1}';
4948
$responseWithOkMessageAndError = $this->createResponse(ResponseHttpCode::OK, $bodyWithMessageAndError);
5049

50+
$this->expectException(ApiErrorException::class);
5151
$this->legacyResponseMapper->map($responseWithOkMessageAndError);
5252
}
5353

5454
/**
5555
* @test
56-
* @expectedException ApiErrorException
5756
*/
5857
public function it_should_throw_exception_on_unrecognized_status()
5958
{
6059
$responseWithUnrecognizedStatus = new Response(400);
6160

61+
$this->expectException(ApiErrorException::class);
6262
$this->legacyResponseMapper->map($responseWithUnrecognizedStatus);
6363
}
6464

tests/Unit/Infrastructure/ResponseMapper/RestResponseMapperTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,24 @@ public function it_should_return_empty_object_on_no_content()
8282

8383
/**
8484
* @test
85-
* @expectedException ApiErrorException
86-
* @expectedExceptionMessage Service unavailable
8785
*/
8886
public function it_should_throw_exception_on_service_unavailable()
8987
{
9088
$responseWithServiceUnavailable = new Response(ResponseHttpCode::SERVICE_UNAVAILABLE);
9189

90+
$this->expectException(ApiErrorException::class);
91+
$this->expectExceptionMessage("Service unavailable");
9292
$this->restResponseMapper->map($responseWithServiceUnavailable);
9393
}
9494

9595
/**
9696
* @test
97-
* @expectedException ApiErrorException
9897
*/
9998
public function it_should_throw_exception_on_unrecognized_status()
10099
{
101100
$responseWithUnrecognizedStatus = new Response(400);
102101

102+
$this->expectException(ApiErrorException::class);
103103
$this->restResponseMapper->map($responseWithUnrecognizedStatus);
104104
}
105105

0 commit comments

Comments
 (0)