You are here

public function BambooTwigLoaderTest::testImage in Bamboo Twig 8.4

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testImage()
  2. 8.2 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testImage()
  3. 8.3 tests/src/Functional/BambooTwigLoaderTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigLoaderTest::testImage()

@covers Drupal\bamboo_twig_loader\TwigExtension\Loader::loadImage

File

tests/src/Functional/BambooTwigLoaderTest.php, line 252

Class

BambooTwigLoaderTest
Tests Loaders twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testImage() {
  $this
    ->drupalGet('/bamboo-twig-loader');

  // Load an image using uri public://antistatique.jpg.
  $this
    ->assertElementPresent('.test-loaders div.loader-image-uri');
  $this
    ->assertElementContains('.test-loaders div.loader-image-uri', $this->file
    ->getFileUri());

  // Load an image using uri public://antistatique.jpg.
  $this
    ->assertElementPresent('.test-loaders div.loader-image-path');
  $this
    ->assertElementContains('.test-loaders div.loader-image-path', 'bamboo_twig_test/files/antistatique.jpg');
}