@@ -707,6 +707,24 @@ public function testAssertConflict()
707
707
$ this ->fail ();
708
708
}
709
709
710
+ public function testAssertGone ()
711
+ {
712
+ $ response = TestResponse::fromBaseResponse (
713
+ (new Response )->setStatusCode (Response::HTTP_GONE )
714
+ );
715
+
716
+ $ response ->assertGone ();
717
+
718
+ $ response = TestResponse::fromBaseResponse (
719
+ (new Response )->setStatusCode (Response::HTTP_OK )
720
+ );
721
+
722
+ $ this ->expectException (AssertionFailedError::class);
723
+ $ this ->expectExceptionMessage ("Expected response status code [410] but received 200. \nFailed asserting that 410 is identical to 200. " );
724
+
725
+ $ response ->assertGone ();
726
+ }
727
+
710
728
public function testAssertTooManyRequests ()
711
729
{
712
730
$ response = TestResponse::fromBaseResponse (
@@ -773,6 +791,42 @@ public function testAssertServerError()
773
791
$ response ->assertServerError ();
774
792
}
775
793
794
+ public function testAssertInternalServerError ()
795
+ {
796
+ $ response = TestResponse::fromBaseResponse (
797
+ (new Response )->setStatusCode (Response::HTTP_INTERNAL_SERVER_ERROR )
798
+ );
799
+
800
+ $ response ->assertInternalServerError ();
801
+
802
+ $ response = TestResponse::fromBaseResponse (
803
+ (new Response )->setStatusCode (Response::HTTP_OK )
804
+ );
805
+
806
+ $ this ->expectException (AssertionFailedError::class);
807
+ $ this ->expectExceptionMessage ("Expected response status code [500] but received 200. \nFailed asserting that 500 is identical to 200. " );
808
+
809
+ $ response ->assertInternalServerError ();
810
+ }
811
+
812
+ public function testAssertServiceUnavailable ()
813
+ {
814
+ $ response = TestResponse::fromBaseResponse (
815
+ (new Response )->setStatusCode (Response::HTTP_SERVICE_UNAVAILABLE )
816
+ );
817
+
818
+ $ response ->assertServiceUnavailable ();
819
+
820
+ $ response = TestResponse::fromBaseResponse (
821
+ (new Response )->setStatusCode (Response::HTTP_OK )
822
+ );
823
+
824
+ $ this ->expectException (AssertionFailedError::class);
825
+ $ this ->expectExceptionMessage ("Expected response status code [503] but received 200. \nFailed asserting that 503 is identical to 200. " );
826
+
827
+ $ response ->assertServiceUnavailable ();
828
+ }
829
+
776
830
public function testAssertNoContentAsserts204StatusCodeByDefault ()
777
831
{
778
832
$ statusCode = 500 ;
0 commit comments