function DateTimePlusTest::testInvalidDateArrays

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

Tests creating dates from invalid array input.

@dataProvider providerTestInvalidDateArrays

Parameters

mixed $input: Input argument for DateTimePlus.

string $timezone: Timezone argument for DateTimePlus.

string $class: The Exception subclass to expect to be thrown.

File

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

Class

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

Namespace

Drupal\Tests\Component\Datetime

Code

public function testInvalidDateArrays($input, $timezone, $class) : void {
    $this->expectException($class);
    $this->assertInstanceOf('\\Drupal\\Component\\DateTimePlus', DateTimePlus::createFromArray($input, $timezone));
}

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