You are here

public function BambooTwigExtensionsTest::testDateDiffTimeAgoForcedUnitNotHumanized 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::testDateDiffTimeAgoForcedUnitNotHumanized()
  2. 8.3 tests/src/Functional/BambooTwigExtensionsTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigExtensionsTest::testDateDiffTimeAgoForcedUnitNotHumanized()
  3. 8.4 tests/src/Functional/BambooTwigExtensionsTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigExtensionsTest::testDateDiffTimeAgoForcedUnitNotHumanized()

Cover the \Twig_Extensions_Extension_Date::diff.

File

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

Class

BambooTwigExtensionsTest
Tests Extensions twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testDateDiffTimeAgoForcedUnitNotHumanized() {
  $this
    ->drupalGet('/bamboo-twig-extensions');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-1', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-2', '-0.016666666666667');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-3', '-5');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-4', '-60');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-5', '-1');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-6', '-302');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-7', '-3660');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-8', '-32702');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-9', '-0.27152777777778');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-10', '-4.2715277777778');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-11', '-30.271527777778');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-12', '-1.0416666666667');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-13', '-6.1083333333333');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-14', '-391.27152777778');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-15', '-37.408333333333');
  $this
    ->assertElementContains('.test-extensions div.date-diff-unit-robot-ago-16', '-3.072553045859');
}