function RecipeFinderTest::testSkipInvalidRecipe

Tests that invalid recipes can be safely skipped, with a log message.

File

core/tests/Drupal/KernelTests/Core/Recipe/RecipeFinderTest.php, line 66

Class

RecipeFinderTest
Tests the recipe finder.

Namespace

Drupal\KernelTests\Core\Recipe

Code

public function testSkipInvalidRecipe() : void {
  $finder = new Finder($this->root . '/core/tests/fixtures/recipes', TRUE, new TestLogger());
  // Convert to an array so that the generator gets run.
  iterator_to_array($finder);
  $this->assertTrue($finder->logger
    ->hasErrorThatContains('foo: !php/enum Drupal\\config_enum_test\\DoesNotExistEnumValue::No'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.