protected function EntityReferenceFieldTranslatedReferenceViewTest::assertEntityReferenceDisplay in Drupal 8
Same name and namespace in other branches
- 9 core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php \Drupal\Tests\field\Functional\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest::assertEntityReferenceDisplay()
- 10 core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php \Drupal\Tests\field\Functional\EntityReference\EntityReferenceFieldTranslatedReferenceViewTest::assertEntityReferenceDisplay()
Assert entity reference display.
1 call to EntityReferenceFieldTranslatedReferenceViewTest::assertEntityReferenceDisplay()
- EntityReferenceFieldTranslatedReferenceViewTest::testEntityReferenceDisplay in core/
modules/ field/ tests/ src/ Functional/ EntityReference/ EntityReferenceFieldTranslatedReferenceViewTest.php - Tests if the entity is displayed in an entity reference field.
File
- core/
modules/ field/ tests/ src/ Functional/ EntityReference/ EntityReferenceFieldTranslatedReferenceViewTest.php, line 178
Class
- EntityReferenceFieldTranslatedReferenceViewTest
- Tests the translation of entity reference field display on nodes.
Namespace
Drupal\Tests\field\Functional\EntityReferenceCode
protected function assertEntityReferenceDisplay() {
$url = $this->referrerEntity
->toUrl();
$translation_url = $this->referrerEntity
->toUrl('canonical', [
'language' => ConfigurableLanguage::load($this->translateToLangcode),
]);
$this
->drupalGet($url);
$this
->assertText($this->labelOfNotTranslatedReference, 'The label of not translated reference is displayed.');
$this
->assertText($this->originalLabel, 'The default label of translated reference is displayed.');
$this
->assertNoText($this->translatedLabel, 'The translated label of translated reference is not displayed.');
$this
->drupalGet($translation_url);
$this
->assertText($this->labelOfNotTranslatedReference, 'The label of not translated reference is displayed.');
$this
->assertNoText($this->originalLabel, 'The default label of translated reference is not displayed.');
$this
->assertText($this->translatedLabel, 'The translated label of translated reference is displayed.');
}