You are here

public function DateTimePlusTest::providerTestDateFormat 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::providerTestDateFormat()

Provides data for testDateFormats.

Return value

array An array of arrays, each containing:

See also

testDateFormats()

File

core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php, line 314
Contains \Drupal\Tests\Component\Datetime\DateTimePlusTest.

Class

DateTimePlusTest
@coversDefaultClass \Drupal\Component\Datetime\DateTimePlus @group Datetime

Namespace

Drupal\Tests\Component\Datetime

Code

public function providerTestDateFormat() {
  return array(
    // Create a year-only date.
    array(
      '2009',
      NULL,
      'Y',
      'Y',
      '2009',
    ),
    // Create a month and year-only date.
    array(
      '2009-10',
      NULL,
      'Y-m',
      'Y-m',
      '2009-10',
    ),
    // Create a time-only date.
    array(
      'T10:30:00',
      NULL,
      '\\TH:i:s',
      'H:i:s',
      '10:30:00',
    ),
    // Create a time-only date.
    array(
      '10:30:00',
      NULL,
      'H:i:s',
      'H:i:s',
      '10:30:00',
    ),
  );
}