@@ -24,6 +24,7 @@ protected function setUp()
2424 public function acceptHeaders ()
2525 {
2626 return [
27+ 'empty ' => ['' , 'application/problem+json ' ],
2728 'application/xml ' => ['application/xml ' , 'application/problem+xml ' ],
2829 'application/vnd.api+xml ' => ['application/vnd.api+xml ' , 'application/problem+xml ' ],
2930 'application/json ' => ['application/json ' , 'application/problem+json ' ],
@@ -36,7 +37,7 @@ public function acceptHeaders()
3637 */
3738 public function testCreateResponseCreatesExpectedType (string $ header , string $ expectedType )
3839 {
39- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ($ header );
40+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ($ header );
4041
4142 $ response = $ this ->factory ->createResponse (
4243 $ this ->request ->reveal (),
@@ -53,7 +54,7 @@ public function testCreateResponseCreatesExpectedType(string $header, string $ex
5354 */
5455 public function testCreateResponseFromThrowableCreatesExpectedType (string $ header , string $ expectedType )
5556 {
56- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ($ header );
57+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ($ header );
5758
5859 $ exception = new RuntimeException ();
5960 $ response = $ this ->factory ->createResponseFromThrowable (
@@ -72,7 +73,7 @@ public function testCreateResponseFromThrowableCreatesExpectedTypeWithExtraInfor
7273 string $ header ,
7374 string $ expectedType
7475 ) {
75- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ($ header );
76+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ($ header );
7677
7778 $ factory = new ProblemDetailsResponseFactory (ProblemDetailsResponseFactory::INCLUDE_THROWABLE_DETAILS );
7879
@@ -98,7 +99,7 @@ public function testCreateResponseFromThrowableWillPullDetailsFromProblemDetails
9899 $ e ->getType ()->willReturn ('https://example.com/api/doc/invalid-client-request ' );
99100 $ e ->getAdditionalData ()->willReturn (['foo ' => 'bar ' ]);
100101
101- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ('application/json ' );
102+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ('application/json ' );
102103
103104 $ factory = new ProblemDetailsResponseFactory ();
104105
@@ -121,7 +122,7 @@ public function testCreateResponseFromThrowableWillPullDetailsFromProblemDetails
121122
122123 public function testFactoryRaisesExceptionIfBodyFactoryDoesNotReturnStream ()
123124 {
124- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ('application/json ' );
125+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ('application/json ' );
125126
126127 $ factory = new ProblemDetailsResponseFactory (false , null , null , function () {
127128 return null ;
@@ -133,7 +134,7 @@ public function testFactoryRaisesExceptionIfBodyFactoryDoesNotReturnStream()
133134
134135 public function testFactoryGeneratesXmlResponseIfNegotiationFails ()
135136 {
136- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ('text/plain ' );
137+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ('text/plain ' );
137138
138139 $ response = $ this ->factory ->createResponse (
139140 $ this ->request ->reveal (),
@@ -147,7 +148,7 @@ public function testFactoryGeneratesXmlResponseIfNegotiationFails()
147148
148149 public function testFactoryRendersPreviousExceptionsInDebugMode ()
149150 {
150- $ this ->request ->getHeaderLine ('Accept ' , ' application/xhtml+xml ' )->willReturn ('application/json ' );
151+ $ this ->request ->getHeaderLine ('Accept ' )->willReturn ('application/json ' );
151152
152153 $ first = new RuntimeException ('first ' , 101010 );
153154 $ second = new RuntimeException ('second ' , 101011 , $ first );
0 commit comments