function DrupalDateTimeTest::providerTestInvalidDateDiff

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php \Drupal\Tests\Core\Datetime\DrupalDateTimeTest::providerTestInvalidDateDiff()
  2. 8.9.x core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php \Drupal\Tests\Core\Datetime\DrupalDateTimeTest::providerTestInvalidDateDiff()
  3. 10 core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php \Drupal\Tests\Core\Datetime\DrupalDateTimeTest::providerTestInvalidDateDiff()

Provides data for date tests.

Return value

array An array of arrays, each containing the input parameters for DateTimePlusTest::testInvalidDateDiff().

See also

DateTimePlusTest::testInvalidDateDiff()

File

core/tests/Drupal/Tests/Core/Datetime/DrupalDateTimeTest.php, line 148

Class

DrupalDateTimeTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Datetime%21DrupalDateTime.php/class/DrupalDateTime/11.x" title="Extends DateTimePlus()." class="local">\Drupal\Core\Datetime\DrupalDateTime</a> @group Datetime

Namespace

Drupal\Tests\Core\Datetime

Code

public static function providerTestInvalidDateDiff() {
    $settings = [
        'langcode' => 'en',
    ];
    $utc_tz = new \DateTimeZone('UTC');
    return [
        [
            'input1' => DrupalDateTime::createFromFormat('U', 3600, $utc_tz, $settings),
            'input2' => '1970-01-01 00:00:00',
            'absolute' => FALSE,
        ],
        [
            'input1' => DrupalDateTime::createFromFormat('U', 3600, $utc_tz, $settings),
            'input2' => NULL,
            'absolute' => FALSE,
        ],
    ];
}

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