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

assertSessionHas() public method

Assert that the session has a given value.
public assertSessionHas ( string | array $key, mixed $value = null )
$key string | array
$value mixed
    public function assertSessionHas($key, $value = null)
    {
        if (is_array($key)) {
            return $this->assertSessionHasAll($key);
        }
        if (is_null($value)) {
            PHPUnit::assertTrue($this->app['session.store']->has($key), "Session missing key: {$key}");
        } else {
            PHPUnit::assertEquals($value, $this->app['session.store']->get($key));
        }
        return $this;
    }