You are here

public function BambooTwigExtensionsTest::testDateDiffTimeAgoNotHumanized in Bamboo Twig 8.5

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

Cover the \Twig_Extensions_Extension_Date::diff.

File

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

Class

BambooTwigExtensionsTest
Tests Extensions twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testDateDiffTimeAgoNotHumanized() {
  $this
    ->drupalGet('/bamboo-twig-extensions');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-1', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-2', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-3', '-5');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-4', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-5', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-6', '-5');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-7', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-8', '-9');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-9', '-6');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-10', '-4');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-11', '-30');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-12', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-13', '-5');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-14', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-15', '-3');
  $this
    ->assertElementContains('.test-extensions div.date-diff-robot-ago-16', '-3');
}