Laravel\Lumen\Testing\AssertionsTrait::assertSessionHas PHP Method

assertSessionHas() public method

Assert that the session has a given list of values.
public assertSessionHas ( string | array $key, mixed $value = null ) : void
$key string | array
$value mixed
return void
    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));
        }
    }