You are here

public function EntityCitationRenderTest::testEntityRender in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/tests/src/Kernel/EntityCitationRenderTest.php \Drupal\Tests\bibcite_entity\Kernel\EntityCitationRenderTest::testEntityRender()

Test rendering Reference entity to citation.

@dataProvider providerReferenceEntity

File

modules/bibcite_entity/tests/src/Kernel/EntityCitationRenderTest.php, line 55

Class

EntityCitationRenderTest
Test rendering of entity to citation.

Namespace

Drupal\Tests\bibcite_entity\Kernel

Code

public function testEntityRender($entity_values, $expected) {
  $entity = Reference::create($entity_values);
  $data = $this->serializer
    ->normalize($entity, 'csl');
  $citation = $this->styler
    ->render($data);
  $this
    ->assertEquals($expected, strip_tags($citation));
}