public function DateTimePlusTest::testInvalidDateArrays in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidDateArrays()
- 10 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\DatetimeCode
public function testInvalidDateArrays($input, $timezone, $class) {
$this
->expectException($class);
$this
->assertInstanceOf('\\Drupal\\Component\\DateTimePlus', DateTimePlus::createFromArray($input, $timezone));
}