Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions src/Illuminate/Testing/TestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,37 @@ public function assertRedirectBack()
return $this;
}

/**
* Assert whether the response is redirecting back to the previous location and the session has the given errors.
*
* @param string|array $keys
* @param mixed $format
* @param string $errorBag
* @return $this
*/
public function assertRedirectBackWithErrors($keys = [], $format = null, $errorBag = 'default')
{
$this->assertRedirectBack();

$this->assertSessionHasErrors($keys, $format, $errorBag);

return $this;
}

/**
* Assert whether the response is redirecting back to the previous location with no errors in the session.
*
* @return $this
*/
public function assertRedirectBackWithoutErrors()
{
$this->assertRedirectBack();

$this->assertSessionHasNoErrors();

return $this;
}

/**
* Assert whether the response is redirecting to a given route.
*
Expand Down