Illuminate\Foundation\Testing\Concerns\InteractsWithSession::assertSessionHasErrors PHP Method

assertSessionHasErrors() public method

Assert that the session has errors bound.
public assertSessionHasErrors ( string | array $bindings = [], mixed $format = null )
$bindings string | array
$format mixed
    public function assertSessionHasErrors($bindings = [], $format = null)
    {
        $this->assertSessionHas('errors');
        $bindings = (array) $bindings;
        $errors = $this->app['session.store']->get('errors');
        foreach ($bindings as $key => $value) {
            if (is_int($key)) {
                PHPUnit::assertTrue($errors->has($value), "Session missing error: {$value}");
            } else {
                PHPUnit::assertContains($value, $errors->get($key, $format));
            }
        }
        return $this;
    }