You are here

public function BambooTwigFileTest::testExtensionGuesser in Bamboo Twig 8.2

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

@covers Drupal\bamboo_twig_file\TwigExtension\File::extensionGuesser

File

tests/src/Functional/BambooTwigFileTest.php, line 26

Class

BambooTwigFileTest
Tests File twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testExtensionGuesser() {
  $this
    ->drupalGet('/bamboo-twig-file');
  $this
    ->assertElementPresent('.test-files div.ext-guesser-pdf');
  $this
    ->assertElementContains('.test-files div.ext-guesser-pdf', 'pdf');
  $this
    ->assertElementPresent('.test-files div.ext-guesser-word-legacy');
  $this
    ->assertElementContains('.test-files div.ext-guesser-word-legacy', 'doc');
  $this
    ->assertElementPresent('.test-files div.ext-guesser-word');
  $this
    ->assertElementContains('.test-files div.ext-guesser-word', 'docx');
  $this
    ->assertElementPresent('.test-files div.ext-guesser-jpg');
  $this
    ->assertElementContains('.test-files div.ext-guesser-jpg', 'jpeg');
}