You are here

public function FrontMatterTest::testFrontMatterSerializerException in Drupal 9

Tests when a passed serializer doesn't implement the proper interface.

@covers ::__construct @covers ::create

File

core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php, line 51

Class

FrontMatterTest
Tests front matter parsing helper methods.

Namespace

Drupal\Tests\Component\FrontMatter

Code

public function testFrontMatterSerializerException() {
  $this
    ->expectException(\AssertionError::class);
  $this
    ->expectExceptionMessage('The $serializer parameter must reference a class that implements Drupal\\Component\\Serialization\\SerializationInterface.');
  FrontMatter::create('', '');
}