function LegacyServiceTest::testAppRoot

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'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.