function FrontMatterTest::testFrontMatterSerializerException

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php \Drupal\Tests\Component\FrontMatter\FrontMatterTest::testFrontMatterSerializerException()
  2. 11.x core/tests/Drupal/Tests/Component/FrontMatter/FrontMatterTest.php \Drupal\Tests\Component\FrontMatter\FrontMatterTest::testFrontMatterSerializerException()

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('', '');
}

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