You are here

abstract class ServiceContainerIntegrationTestBase in Service Container 7

Same name and namespace in other branches
  1. 7.2 lib/Drupal/service_container/Tests/ServiceContainerIntegrationTestBase.php \Drupal\service_container\Tests\ServiceContainerIntegrationTestBase

Hierarchy

Expanded class hierarchy of ServiceContainerIntegrationTestBase

4 files declare their use of ServiceContainerIntegrationTestBase
GarbageCollectionTest.php in lib/Drupal/service_container/Tests/KeyValue/GarbageCollectionTest.php
Contains Drupal\system\Tests\KeyValueStore\GarbageCollectionTest.
ServiceContainerAnnotationDiscoveryIntegrationTest.php in modules/providers/service_container_annotation_discovery/lib/Drupal/service_container_annotation_discovery/Tests/ServiceContainerAnnotationDiscoveryIntegrationTest.php
Contains \Drupal\service_container_annotation_discovery\Tests\ServiceContainerBlockIntegrationTest.
ServiceContainerSymfonyTest.php in modules/providers/service_container_symfony/lib/Drupal/service_container_symfony/Tests/ServiceContainerSymfonyTest.php
Contains \Drupal\service_container_symfony\Tests\ServiceContainerSymfonyTest.
StorageTestBase.php in lib/Drupal/service_container/Tests/KeyValue/StorageTestBase.php
Contains Drupal\service_container\Tests\KeyValue\StorageTestBase.

File

lib/Drupal/service_container/Tests/ServiceContainerIntegrationTestBase.php, line 10
Contains \Drupal\service_container\Tests\ServiceContainerIntegrationTestBase.

Namespace

Drupal\service_container\Tests
View source
abstract class ServiceContainerIntegrationTestBase extends \DrupalWebTestCase {

  /**
   * The profile to install as a basis for testing.
   *
   * @var string
   */
  protected $profile = 'testing';

  /**
   * The dependency injection container usable in the test.
   *
   * @var \Drupal\service_container\DependencyInjection\ContainerInterface
   */
  protected $container;

  /**
   * {@inheritdoc}
   */
  protected function setUp() {

    // Support both an array of modules and a single module.
    $modules = func_get_args();
    if (isset($modules[0]) && is_array($modules[0])) {
      $modules = $modules[0];
    }
    $modules[] = 'service_container';
    parent::setUp($modules);
    \ServiceContainer::init();
    $this->container = \Drupal::getContainer();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ServiceContainerIntegrationTestBase::$container protected property The dependency injection container usable in the test.
ServiceContainerIntegrationTestBase::$profile protected property The profile to install as a basis for testing. 1
ServiceContainerIntegrationTestBase::setUp protected function 5