diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index 633c9b45b414..f830cb9ec408 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -64,6 +64,21 @@ public function assertSuccessful() return $this; } + /** + * Assert that the response has an OK status code. + * + * @return $this + */ + public function assertOk() + { + PHPUnit::assertTrue( + $this->isOk(), + 'Response status code [' . $this->getStatusCode() . '] is not an OK status code.' + ); + + return $this; + } + /** * Assert that the response has a not found status code. *