public function BambooTwigExtensionsTest::testDateDiffTimeAgoAuto in Bamboo Twig 8.4
Same name and namespace in other branches
- 8.5 tests/src/Functional/BambooTwigExtensionsTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigExtensionsTest::testDateDiffTimeAgoAuto()
- 8.2 tests/src/Functional/BambooTwigExtensionsTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigExtensionsTest::testDateDiffTimeAgoAuto()
- 8.3 tests/src/Functional/BambooTwigExtensionsTest.php \Drupal\Tests\bamboo_twig\Functional\BambooTwigExtensionsTest::testDateDiffTimeAgoAuto()
Cover the \Twig_Extensions_Extension_Date::diff.
File
- tests/
src/ Functional/ BambooTwigExtensionsTest.php, line 67
Class
- BambooTwigExtensionsTest
- Tests Extensions twig filters and functions.
Namespace
Drupal\Tests\bamboo_twig\FunctionalCode
public function testDateDiffTimeAgoAuto() {
$this
->drupalGet('/bamboo-twig-extensions');
$this
->assertElementContains('.test-extensions div.date-diff-ago-1', '1 second ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-2', '5 seconds ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-3', '1 minute ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-4', '5 minutes ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-5', '1 hour ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-6', '9 hours ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-7', '1 day ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-8', '4 days ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-9', '30 days ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-10', '1 month ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-11', '5 months ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-12', '1 year ago');
$this
->assertElementContains('.test-extensions div.date-diff-ago-13', '3 years ago');
}