You are here

public function RequestStackTest::testGetCurrentRequest in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestStackTest.php \Symfony\Component\HttpFoundation\Tests\RequestStackTest::testGetCurrentRequest()

File

vendor/symfony/http-foundation/Tests/RequestStackTest.php, line 19

Class

RequestStackTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetCurrentRequest() {
  $requestStack = new RequestStack();
  $this
    ->assertNull($requestStack
    ->getCurrentRequest());
  $request = Request::create('/foo');
  $requestStack
    ->push($request);
  $this
    ->assertSame($request, $requestStack
    ->getCurrentRequest());
  $this
    ->assertSame($request, $requestStack
    ->pop());
  $this
    ->assertNull($requestStack
    ->getCurrentRequest());
  $this
    ->assertNull($requestStack
    ->pop());
}