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. 10 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidDateArrays()
  3. 11.x core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidDateArrays()

Test 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 107

Class

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

Namespace

Drupal\Tests\Component\Datetime

Code

public function testInvalidDateArrays($input, $timezone, $class) {
    $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.