File tree 2 files changed +5
-5
lines changed
tests/Unit/Infrastructure/ResponseMapper
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -41,24 +41,24 @@ public function it_should_return_decoded_body_on_ok()
41
41
42
42
/**
43
43
* @test
44
- * @expectedException ApiErrorException
45
44
*/
46
45
public function it_should_return_error_on_ok_with_message_and_error ()
47
46
{
48
47
$ bodyWithMessageAndError = '{"message":"some message","error":1} ' ;
49
48
$ responseWithOkMessageAndError = $ this ->createResponse (ResponseHttpCode::OK , $ bodyWithMessageAndError );
50
49
50
+ $ this ->expectException (ApiErrorException::class);
51
51
$ this ->legacyResponseMapper ->map ($ responseWithOkMessageAndError );
52
52
}
53
53
54
54
/**
55
55
* @test
56
- * @expectedException ApiErrorException
57
56
*/
58
57
public function it_should_throw_exception_on_unrecognized_status ()
59
58
{
60
59
$ responseWithUnrecognizedStatus = new Response (400 );
61
60
61
+ $ this ->expectException (ApiErrorException::class);
62
62
$ this ->legacyResponseMapper ->map ($ responseWithUnrecognizedStatus );
63
63
}
64
64
Original file line number Diff line number Diff line change @@ -82,24 +82,24 @@ public function it_should_return_empty_object_on_no_content()
82
82
83
83
/**
84
84
* @test
85
- * @expectedException ApiErrorException
86
- * @expectedExceptionMessage Service unavailable
87
85
*/
88
86
public function it_should_throw_exception_on_service_unavailable ()
89
87
{
90
88
$ responseWithServiceUnavailable = new Response (ResponseHttpCode::SERVICE_UNAVAILABLE );
91
89
90
+ $ this ->expectException (ApiErrorException::class);
91
+ $ this ->expectExceptionMessage ("Service unavailable " );
92
92
$ this ->restResponseMapper ->map ($ responseWithServiceUnavailable );
93
93
}
94
94
95
95
/**
96
96
* @test
97
- * @expectedException ApiErrorException
98
97
*/
99
98
public function it_should_throw_exception_on_unrecognized_status ()
100
99
{
101
100
$ responseWithUnrecognizedStatus = new Response (400 );
102
101
102
+ $ this ->expectException (ApiErrorException::class);
103
103
$ this ->restResponseMapper ->map ($ responseWithUnrecognizedStatus );
104
104
}
105
105
You can’t perform that action at this time.
0 commit comments