You are here

public function RequestStackLegacyTest::testGetMainRequestDeprecation in Drupal 10

Tests deprecation message in our subclassed RequestStack.

@covers ::getMainRequest

File

core/tests/Drupal/Tests/Core/Http/RequestStackLegacyTest.php, line 21

Class

RequestStackLegacyTest
@coversDefaultClass \Drupal\Core\Http\RequestStack @group legacy

Namespace

Drupal\Tests\Core\Http

Code

public function testGetMainRequestDeprecation() {
  $stack = new RequestStack();
  $this
    ->expectDeprecation('The Drupal\\Core\\Http\\RequestStack is deprecated in drupal:10.0.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3265357');
  $this
    ->assertNull($stack
    ->getMainRequest());
}