Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / simpletest / src / TestServiceProvider.php
index 0097803deec4ab85da30c1dc1392d4c582152633..151260c59d87968a0603949d362e2aa3c5013317 100644 (file)
@@ -2,54 +2,16 @@
 
 namespace Drupal\simpletest;
 
-use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\Core\DependencyInjection\ServiceModifierInterface;
-use Drupal\Core\DependencyInjection\ServiceProviderInterface;
-use Symfony\Component\DependencyInjection\Definition;
-
-class TestServiceProvider implements ServiceProviderInterface, ServiceModifierInterface {
-
-  /**
-   * @var \Drupal\simpletest\TestBase;
-   */
-  public static $currentTest;
-
-  /**
-   * {@inheritdoc}
-   */
-  public function register(ContainerBuilder $container) {
-    if (static::$currentTest && method_exists(static::$currentTest, 'containerBuild')) {
-      static::$currentTest->containerBuild($container);
-    }
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function alter(ContainerBuilder $container) {
-    if (static::$currentTest instanceof KernelTestBase) {
-      static::addRouteProvider($container);
-    }
-  }
-
-  /**
-   * Add the on demand rebuild route provider service.
-   *
-   * @param \Drupal\Core\DependencyInjection\ContainerBuilder $container
-   */
-  public static function addRouteProvider(ContainerBuilder $container) {
-    foreach (['router.route_provider' => 'RouteProvider'] as $original_id => $class) {
-      // While $container->get() does a recursive resolve, getDefinition() does
-      // not, so do it ourselves.
-      // @todo Make the code more readable in
-      //   https://www.drupal.org/node/2911498.
-      for ($id = $original_id; $container->hasAlias($id); $id = (string) $container->getAlias($id)) {
-      }
-      $definition = $container->getDefinition($id);
-      $definition->clearTag('needs_destruction');
-      $container->setDefinition("simpletest.$original_id", $definition);
-      $container->setDefinition($id, new Definition('Drupal\simpletest\\' . $class));
-    }
-  }
+use Drupal\KernelTests\TestServiceProvider as CoreTestServiceProvider;
+
+/**
+ * Provides special routing services for tests.
+ *
+ * @deprecated in 8.6.0 for removal before Drupal 9.0.0. Use
+ *   Drupal\KernelTests\TestServiceProvider instead.
+ *
+ * @see https://www.drupal.org/node/2943146
+ */
+class TestServiceProvider extends CoreTestServiceProvider {
 
 }