Commit 61bc211b authored by catch's avatar catch
Browse files

Issue #3259024 by longwave: Remove deprecated 'app.root' and 'site.path' services

parent faeacbea
Loading
Loading
Loading
Loading
+0 −22
Original line number Diff line number Diff line
@@ -725,28 +725,6 @@ services:
  event_dispatcher:
    class: Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher
    arguments: ['@service_container']
  app.root:
    class: \SplString
    factory: ['@app.root.factory', 'get']
    deprecated: The "%service_id%" 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
    tags:
      - { name: parameter_service }
  app.root.factory:
    class: Drupal\Core\AppRootFactory
    arguments: ['@kernel']
    public: false
    deprecated: The "%service_id%" 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
  site.path:
    class: \SplString
    factory: ['@site.path.factory', 'get']
    deprecated: The "%service_id%" 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
    tags:
      - { name: parameter_service }
  site.path.factory:
    class: Drupal\Core\SitePathFactory
    arguments: ['@kernel']
    public: false
    deprecated: The "%service_id%" 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
  controller_resolver:
    class: Drupal\Core\Controller\ControllerResolver
    arguments: ['@psr7.http_message_factory', '@class_resolver']
+0 −18
Original line number Diff line number Diff line
@@ -12,24 +12,6 @@
 */
class LegacyServiceTest extends KernelTestBase {

  /**
   * Tests the site.path service.
   */
  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'));
  }

  /**
   * Tests the app.root service.
   */
  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'));
  }

  /**
   * Tests the deprecated Laminas Feed services.
   *