You are here

public function DateTimePlusTest::testDateTimestamp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 127
Contains \Drupal\Tests\Component\Datetime\DateTimePlusTest.

Class

DateTimePlusTest
@coversDefaultClass \Drupal\Component\Datetime\DateTimePlus @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);
}