function LegacyServiceTest::testSitePath

Tests the site.path service.

File

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

Class

LegacyServiceTest
Tests deprecated core services.

Namespace

Drupal\KernelTests\Core

Code

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

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