public function BambooTwigLoaderTest::testField in Bamboo Twig 8.5
Same name and namespace in other branches
- 8 tests/src/Functional/BambooTwigLoadersTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testField()
- 8.2 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testField()
- 8.3 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testField()
- 8.4 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testField()
@covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadField
File
- tests/
src/ Functional/ BambooTwigLoaderTest.php, line 171
Class
- BambooTwigLoaderTest
- Tests Loaders twig filters and functions.
Namespace
Drupal\Tests\bamboo_twig\FunctionalCode
public function testField() {
$this
->drupalGet('/bamboo-twig-loader');
// Load field article (node).
$this
->assertElementContains('.test-loaders div.loader-field-node-1', 'News N°1');
$this
->assertElementContains('.test-loaders div.loader-field-node-2', 'News N°2');
$this
->assertElementContains('.test-loaders div.loader-field-node-3', 'News N°3');
$this
->assertElementContains('.test-loaders div.loader-field-node-4', 'Article N°4');
$this
->assertElementContains('.test-loaders div.loader-field-node-5', 'News N°5');
// Load field tag (taxonomy).
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-1', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-2', 'Tag N°2');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-3', 'Tag N°3');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-4', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-5', 'Tag N°5');
// Load entity article (node) referenced field.
// Referenced field will always display the entity in its own original lang.
$this
->assertElementContains('.test-loaders div.loader-field-reference-1', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-reference-2', 'Tag N°2');
$this
->assertElementContains('.test-loaders div.loader-field-reference-3', 'Tag N°3');
$this
->assertElementContains('.test-loaders div.loader-field-reference-4', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-reference-5', 'Mot clé N°5');
// Load field file.
$this
->assertElementContains('.test-loaders div.loader-field-file', $this->file->filename->value);
// Load field user.
$this
->assertElementContains('.test-loaders div.loader-field-user', 'admin');
$this
->drupalGet('/fr/bamboo-twig-loader');
// Load field article (node) - French.
$this
->assertElementContains('.test-loaders div.loader-field-node-1', 'News N°1');
$this
->assertElementContains('.test-loaders div.loader-field-node-2', 'Article N°2');
$this
->assertElementContains('.test-loaders div.loader-field-node-3', 'Article N°3');
$this
->assertElementContains('.test-loaders div.loader-field-node-4', 'Article N°4');
$this
->assertElementContains('.test-loaders div.loader-field-node-5', 'Article N°5');
// Load field tag (taxonomy) - French.
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-1', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-2', 'Mot clé N°2');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-3', 'Mot clé N°3');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-4', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-5', 'Mot clé N°5');
// Load entity article (node) referenced field - French.
// Referenced field will always display the entity in its own original lang.
$this
->assertElementContains('.test-loaders div.loader-field-reference-1', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-reference-2', 'Tag N°2');
$this
->assertElementContains('.test-loaders div.loader-field-reference-3', 'Tag N°3');
$this
->assertElementContains('.test-loaders div.loader-field-reference-4', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-reference-5', 'Mot clé N°5');
$this
->drupalGet('/de/bamboo-twig-loader');
// Load field article (node) - German.
$this
->assertElementContains('.test-loaders div.loader-field-node-1', 'News N°1');
$this
->assertElementContains('.test-loaders div.loader-field-node-2', 'News N°2');
$this
->assertElementContains('.test-loaders div.loader-field-node-3', 'Artikel N°3');
$this
->assertElementContains('.test-loaders div.loader-field-node-4', 'Article N°4');
$this
->assertElementContains('.test-loaders div.loader-field-node-5', 'News N°5');
// Load field tag (taxonomy) - German.
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-1', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-2', 'Tag N°2');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-3', 'Stichworte N°3');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-4', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-taxonomy-term-5', 'Tag N°5');
// Load entity article (node) referenced field - German.
// Referenced field will always display the entity in its own original lang.
$this
->assertElementContains('.test-loaders div.loader-field-reference-1', 'Mot clé N°4');
$this
->assertElementContains('.test-loaders div.loader-field-reference-2', 'Tag N°2');
$this
->assertElementContains('.test-loaders div.loader-field-reference-3', 'Tag N°3');
$this
->assertElementContains('.test-loaders div.loader-field-reference-4', 'Tag N°1');
$this
->assertElementContains('.test-loaders div.loader-field-reference-5', 'Mot clé N°5');
}