You are here

public function CompiledRouteLegacyTest::testRequirementsDeprecated in Drupal 9

@covers ::getRequirements

File

core/tests/Drupal/Tests/Core/Routing/CompiledRouteLegacyTest.php, line 113

Class

CompiledRouteLegacyTest
@coversDefaultClass \Drupal\Core\Routing\CompiledRoute @group Routing @group legacy

Namespace

Drupal\Tests\Core\Routing

Code

public function testRequirementsDeprecated() {
  $this
    ->expectDeprecation('Drupal\\Core\\Routing\\CompiledRoute::getRequirements() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. No direct replacement is provided. See https://www.drupal.org/node/3159706');
  if (PHP_VERSION_ID >= 80000) {
    $this
      ->expectWarning();
    $this
      ->expectWarningMessage('Undefined property: Drupal\\Core\\Routing\\CompiledRoute::$route');
  }
  else {
    $this
      ->expectNotice();
    $this
      ->expectNoticeMessage('Undefined property: Drupal\\Core\\Routing\\CompiledRoute::$route');
  }
  $this->compiled_route
    ->getRequirements();
}