function FinderTest::testExceptionIfNoUuid

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/DefaultContent/FinderTest.php \Drupal\Tests\Core\DefaultContent\FinderTest::testExceptionIfNoUuid()

Tests that files without UUIDs will raise an exception.

File

core/tests/Drupal/Tests/Core/DefaultContent/FinderTest.php, line 76

Class

FinderTest
@covers \Drupal\Core\DefaultContent\Finder[[api-linebreak]] @group DefaultContent

Namespace

Drupal\Tests\Core\DefaultContent

Code

public function testExceptionIfNoUuid() : void {
  $this->expectException(ImportException::class);
  $this->expectExceptionMessageMatches("#/no-uuid\\.yml does not have a UUID\\.\$#");
  new Finder(__DIR__ . '/../../../../fixtures/default_content_broken');
}

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