function DateTimePlusTest::testDateTimestamp

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testDateTimestamp()
  2. 10 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testDateTimestamp()
  3. 11.x core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testDateTimestamp()

Test creating dates from datetime strings.

@dataProvider providerTestDateTimestamp

Parameters

string $input: Input argument for DateTimePlus().

array $initial: @see testTimestamp()

array $transform: @see testTimestamp()

File

core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php, line 178

Class

DateTimePlusTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Component%21Datetime%21DateTimePlus.php/class/DateTimePlus/8.9.x" title="Wraps DateTime()." class="local">\Drupal\Component\Datetime\DateTimePlus</a> @group Datetime

Namespace

Drupal\Tests\Component\Datetime

Code

public function testDateTimestamp($input, array $initial, array $transform) {
    // Initialize a new date object.
    $date = new DateTimePlus($input, $initial['timezone']);
    $this->assertDateTimestamp($date, $input, $initial, $transform);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.