You are here

public function LegacyServiceTest::testAppRoot in Drupal 9

Tests the app.root service.

File

core/tests/Drupal/KernelTests/Core/LegacyServiceTest.php, line 27

Class

LegacyServiceTest
Tests deprecated core services.

Namespace

Drupal\KernelTests\Core

Code

public function testAppRoot() {
  $this
    ->expectDeprecation('The "app.root" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612');
  $this
    ->expectDeprecation('The "app.root.factory" service is deprecated in drupal:9.0.0 and is removed from drupal:10.0.0. Use the app.root parameter instead. See https://www.drupal.org/node/3080612');
  $this
    ->assertSame($this->container
    ->get('app.root'), (string) $this->container
    ->getParameter('app.root'));
}