The session function may be used to get or set session values:
<?php $value = session('key');
<?php         $response = $this->get('expected-route-1');

        $response->assertOk();

        $this->assertSame('http://localhost/expected-route-1', session()->previousUrl());



        $this->app->bind(CallableDispatcherContract::class, fn ($app) => new CallableDispatcher($app));
<?php         $response = $this->get('precognition-route', ['Precognition' => 'true']);

        $response->assertNoContent();

        $this->assertSame('http://localhost/expected-route-1', session()->previousUrl());



        $this->app->bind(CallableDispatcherContract::class, fn ($app) => new CallableDispatcher($app));
<?php         $response = $this->get('expected-route-2');

        $response->assertOk();

        $this->assertSame('http://localhost/expected-route-2', session()->previousUrl());

    }



    public function testItAppendsVaryHeaderToSymfonyResponse()