You are here

public function BambooTwigExtensionsTest::testArrayShuffle in Bamboo Twig 8.4

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

Cover the \Twig_Extensions_Extension_Array::twig_shuffle_filter.

File

tests/src/Functional/BambooTwigExtensionsTest.php, line 50

Class

BambooTwigExtensionsTest
Tests Extensions twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testArrayShuffle() {
  $this
    ->drupalGet('/bamboo-twig-extensions');
  $this
    ->assertElementPresent('.test-extensions div.array-shuffle-1');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-1', '1');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-1', '2');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-1', '3');
  $this
    ->assertElementPresent('.test-extensions div.array-shuffle-2');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-2', 'orange');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-2', 'apple');
  $this
    ->assertElementContains('.test-extensions div.array-shuffle-2', 'citrus');
}