You are here

public function BambooTwigI18nTest::testFormatDate in Bamboo Twig 8.4

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

@covers Drupal\bamboo_twig_i18n\TwigExtension\I18n::formatDate

File

tests/src/Functional/BambooTwigI18nTest.php, line 93

Class

BambooTwigI18nTest
Tests I18n twig filters and functions.

Namespace

Drupal\Tests\bamboo_twig\Functional

Code

public function testFormatDate() {
  $this
    ->drupalGet('/bamboo-twig-i18n');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-string', 'Thursday 24th July 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-timestamp', 'Thursday 24th July 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetime', 'Thursday 24th July 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetimeplus', 'Thursday 24th July 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-drupaldatetime', 'Thursday 24th July 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetime-medium', 'Thu, 07/24/2014');
  $this
    ->drupalGet('/fr/bamboo-twig-i18n');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-string', 'Jeudi 24th Juillet 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-timestamp', 'Jeudi 24th Juillet 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetime', 'Jeudi 24th Juillet 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetimeplus', 'Jeudi 24th Juillet 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-drupaldatetime', 'Jeudi 24th Juillet 2014');
  $this
    ->assertElementContains('.test-i18n div.i18n-format-date-datetime-medium', 'Jeu, 07/24/2014');
}