You are here

class ServiceContainerSymfonyTest in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Drupal/service_container_symfony/Tests/ServiceContainerSymfonyTest.php \Drupal\service_container_symfony\Tests\ServiceContainerSymfonyTest

Hierarchy

Expanded class hierarchy of ServiceContainerSymfonyTest

1 string reference to 'ServiceContainerSymfonyTest'
ServiceContainerSymfonyTest::getInfo in modules/providers/service_container_symfony/lib/Drupal/service_container_symfony/Tests/ServiceContainerSymfonyTest.php

File

modules/providers/service_container_symfony/lib/Drupal/service_container_symfony/Tests/ServiceContainerSymfonyTest.php, line 12
Contains \Drupal\service_container_symfony\Tests\ServiceContainerSymfonyTest.

Namespace

Drupal\service_container_symfony\Tests
View source
class ServiceContainerSymfonyTest extends ServiceContainerIntegrationTestBase {

  /**
   * {@inheritdoc}
   */
  public static function getInfo() {
    return array(
      'name' => 'ServiceContainerSymfonyTest',
      'description' => 'Tests the \\ServiceContainerSymfony class',
      'group' => 'service_container',
    );
  }

  /**
   * {@inheritdoc}
   */
  protected function setUp() {
    $modules[] = 'service_container_symfony_test';
    $modules[] = 'service_container_symfony_subtest';
    parent::setUp($modules);
  }

  /**
   * Tests some basic
   */
  public function testInit() {
    $this
      ->assertTrue(\Drupal::hasService('service_container_symfony_test_yolo'));
    $this
      ->assertFalse(\Drupal::hasService('service_container_symfony_test_yolo1'));
  }

  /**
   * Tests with multiple modules enabled.
   */
  public function testMultiple() {
    $this
      ->assertTrue(\Drupal::hasService('service_container_symfony_test_yolo'));
    $this
      ->assertFalse(\Drupal::hasService('service_container_symfony_test_yolo1'));
    $this
      ->assertTrue(\Drupal::hasService('service_container_symfony_subtest_yolo'));
    $this
      ->assertFalse(\Drupal::hasService('service_container_symfony_subtest_yolo1'));
  }

}

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
ServiceContainerSymfonyTest::getInfo public static function
ServiceContainerSymfonyTest::setUp protected function Overrides ServiceContainerIntegrationTestBase::setUp
ServiceContainerSymfonyTest::testInit public function Tests some basic
ServiceContainerSymfonyTest::testMultiple public function Tests with multiple modules enabled.