You are here

public function ModuleFuncsTest::testVxbDateInt in Views XML Backend 8

Tests for views_xml_backend_date().

File

tests/src/Unit/ModuleFuncsTest.php, line 20
Contains \Drupal\Tests\views_xml_backend\Unit\ViewsXmlBackendTestBase.

Class

ModuleFuncsTest
Module function tests.

Namespace

Drupal\Tests\views_xml_backend\Unit

Code

public function testVxbDateInt() {
  $this
    ->assertSame(strtotime('March 9, 2005 08:14:15'), views_xml_backend_date('March 9, 2005 08:14:15', 'second'));
  $this
    ->assertSame(strtotime('March 9, 2005 08:14:00'), views_xml_backend_date('March 9, 2005 08:14:15', 'minute'));
  $this
    ->assertSame(strtotime('March 9, 2005 08:00:00'), views_xml_backend_date('March 9, 2005 08:14:15', 'hour'));
  $this
    ->assertSame(strtotime('March 9, 2005'), views_xml_backend_date('March 9, 2005 08:14:15', 'day'));
  $this
    ->assertSame(strtotime('March 2005'), views_xml_backend_date('March 9, 2005 08:14:15', 'month'));
  $this
    ->assertSame(strtotime('January 2005'), views_xml_backend_date('March 9, 2005 08:14:15', 'year'));
  $this
    ->assertSame(strtotime('January 1, 2005'), views_xml_backend_date('2005', 'year'));
}