You are here

public function CivicrmStorageGetTest::datetimeTimezoneDataProvider in CiviCRM Entity 8.3

File

tests/src/Kernel/CivicrmStorageGetTest.php, line 96

Class

CivicrmStorageGetTest
Tests the storage.

Namespace

Drupal\Tests\civicrm_entity\Kernel

Code

public function datetimeTimezoneDataProvider() {
  (yield [
    [
      'start_date' => '2018-05-02 17:00:00',
      'end_date' => '2018-05-04 17:00:00',
    ],
    //  America/Chicago is UTC-5
    [
      'start_date' => '2018-05-02T22:00:00',
      'end_date' => '2018-05-04T22:00:00',
    ],
    'America/Chicago',
  ]);
  (yield [
    [
      'start_date' => '2018-05-02 17:00:00',
      'end_date' => '2018-05-04 17:00:00',
    ],
    [
      'start_date' => '2018-05-02T17:00:00',
      'end_date' => '2018-05-04T17:00:00',
    ],
    'UTC',
  ]);
  (yield [
    [
      'start_date' => '2018-05-02 17:00:00',
      'end_date' => '2018-05-04 17:00:00',
    ],
    // Europe/Berlin if UTC-2
    [
      'start_date' => '2018-05-02T15:00:00',
      'end_date' => '2018-05-04T15:00:00',
    ],
    'Europe/Berlin',
  ]);
}