You are here

public function PreprocessEventPassTest::testBuilderHasAllServices in Hook Event Dispatcher 3.x

Same name and namespace in other branches
  1. 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/PreprocessEventPassTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\PreprocessEventPassTest::testBuilderHasAllServices()

Test if the ContainerBuilder has all services from the YAML file.

File

modules/preprocess_event_dispatcher/tests/src/Unit/PreprocessEventPassTest.php, line 56

Class

PreprocessEventPassTest
Class PreprocessEventPassTest.

Namespace

Drupal\Tests\preprocess_event_dispatcher\Unit

Code

public function testBuilderHasAllServices() : void {
  $this->pass
    ->process($this->builder);
  $this->builder
    ->compile();
  $services = YamlDefinitionsLoader::getInstance()
    ->getServices();
  foreach (array_keys($services) as $id) {
    self::assertTrue($this->builder
      ->has($id));
  }
}