You are here

public function FactoryMapperTest::testYamlHasAllFactories in Hook Event Dispatcher 8

Test if all factories are in the YAML file.

File

tests/src/Unit/Preprocess/FactoryMapperTest.php, line 32

Class

FactoryMapperTest
Class FactoryMapperTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\Preprocess

Code

public function testYamlHasAllFactories() {
  $factoriesYaml = YamlDefinitionsLoader::getInstance()
    ->getFactories();
  $classNames = $this
    ->getFactoryClassNamesFromFilesystem();
  self::assertCount(\count($factoriesYaml), $classNames);
  foreach ($factoriesYaml as $entry) {
    self::assertContains($entry['class'], $classNames);
  }
}