Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into shadoWalker89-patch-3
  • Loading branch information
taylorotwell committed Oct 8, 2018
2 parents 51cec6a + 5c4ee8e commit 5e7832c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/Illuminate/Foundation/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -885,11 +885,23 @@ public function assertSessionHasErrors($keys = [], $format = null, $errorBag = '
/**
* Assert that the session has no errors.
*
* @param string|array $keys
* @param string $errorBag
* @return $this
*/
public function assertSessionHasNoErrors()
public function assertSessionHasNoErrors($keys = [], $errorBag = 'default')
{
$this->assertSessionMissing('errors');
$keys = (array) $keys;

if (empty($keys)) {
return $this->assertSessionMissing('errors');
}

$errors = $this->session()->get('errors')->getBag($errorBag);

foreach ($keys as $key) {
PHPUnit::assertFalse($errors->has($key), "Session has an unexpected error: $key");
}

return $this;
}
Expand Down

0 comments on commit 5e7832c

Please sign in to comment.