Skip to content

Commit

Permalink
add assertOk() response assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
chapeupreto committed Jun 9, 2018
1 parent 47ded05 commit ffae59a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit ffae59a

Please sign in to comment.