Skip to content
Snippets Groups Projects
Verified Commit 5839fb2c authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3299024 by amarlata, reenaraghavan, quietone, larowlan:...

Issue #3299024 by amarlata, reenaraghavan, quietone, larowlan: EntityReferenceFormatterTest should use ->label()

(cherry picked from commit 94a40596)
parent d3d20314
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,7 @@ public function testEntityFormatterRecursiveRendering() {
// the entity title because we're rendering the full entity, not just the
// reference field.
$expected_occurrences = EntityReferenceEntityFormatter::RECURSIVE_RENDER_LIMIT * 2 + 2;
$actual_occurrences = substr_count($output, $referencing_entity_1->name->value);
$actual_occurrences = substr_count($output, $referencing_entity_1->label());
$this->assertEquals($expected_occurrences, $actual_occurrences);
// Repeat the process with another entity in order to check that the
......@@ -280,17 +280,17 @@ public function testEntityFormatterRecursiveRendering() {
$build = $view_builder->view($referencing_entity_2, 'default');
$output = $renderer->renderRoot($build);
$actual_occurrences = substr_count($output, $referencing_entity_2->name->value);
$actual_occurrences = substr_count($output, $referencing_entity_2->label());
$this->assertEquals($expected_occurrences, $actual_occurrences);
// Now render both entities at the same time and check again.
$build = $view_builder->viewMultiple([$referencing_entity_1, $referencing_entity_2], 'default');
$output = $renderer->renderRoot($build);
$actual_occurrences = substr_count($output, $referencing_entity_1->name->value);
$actual_occurrences = substr_count($output, $referencing_entity_1->label());
$this->assertEquals($expected_occurrences, $actual_occurrences);
$actual_occurrences = substr_count($output, $referencing_entity_2->name->value);
$actual_occurrences = substr_count($output, $referencing_entity_2->label());
$this->assertEquals($expected_occurrences, $actual_occurrences);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment