You are here

public function BambooTwigExtensionsI18nTest::testDateDiffTimeAgoAuto in Bamboo Twig 8.3

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

Cover the \Twig_Extensions_Extension_Date::diff.

File

tests/src/Functional/BambooTwigExtensionsI18nTest.php, line 287

Class

BambooTwigExtensionsI18nTest
Tests Extensions i18n of twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testDateDiffTimeAgoAuto() {
  $this
    ->drupalGet('/fr/bamboo-twig-extensions');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-1', 'il y a 1 seconde');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-2', 'il y a 5 secondes');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-3', 'il y a 1 minute');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-4', 'il y a 5 minutes');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-5', 'il y a 1 heure');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-6', 'il y a 9 heures');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-7', 'il y a 1 jour');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-8', 'il y a 4 jours');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-10', 'il y a 1 mois');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-11', 'il y a 5 mois');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-12', 'il y a 1 an');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-13', 'il y a 3 ans');
  $this
    ->drupalGet('/de/bamboo-twig-extensions');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-1', 'vor 1 Sekunde');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-2', 'vor 5 Sekunden');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-3', 'vor 1 Minute');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-4', 'vor 5 Minuten');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-5', 'vor 1 Stunde');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-6', 'vor 9 Stunden');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-7', 'vor 1 Tag');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-8', 'vor 4 Tagen');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-10', 'vor 1 Monat');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-11', 'vor 5 Monaten');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-12', 'vor 1 Jahr');
  $this
    ->assertElementContains('.test-extensions div.date-diff-ago-13', 'vor 3 Jahren');
}