Skip to content

Commit c5a5143

Browse files
committed
add test for JSON response with null as content
1 parent fd44aca commit c5a5143

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/JsonResponseTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ public function testConstructorWithObjectWithoutToStringMethodThrowsAnException(
294294

295295
new JsonResponse(new \stdClass(), 200, [], true);
296296
}
297+
298+
public function testSetDataWithNull()
299+
{
300+
$response = new JsonResponse();
301+
$response->setData(null);
302+
303+
$this->assertSame('null', $response->getContent());
304+
}
297305
}
298306

299307
class JsonSerializableObject implements \JsonSerializable

0 commit comments

Comments
 (0)