You are here

public function PreprocessEventPassTest::testBuilderHasAllServices in Hook Event Dispatcher 8

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

File

tests/src/Unit/Preprocess/PreprocessEventPassTest.php, line 54

Class

PreprocessEventPassTest
Class PreprocessEventPassTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Preprocess

Code

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