public function DateTimePlusTest::testInvalidConstructor in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidConstructor()
Tests invalid values passed to constructor.
@covers ::__construct
@dataProvider providerTestInvalidConstructor
Parameters
string $time: A date/time string.
string[] $errors: An array of error messages.
File
- core/
tests/ Drupal/ Tests/ Component/ Datetime/ DateTimePlusTest.php, line 753
Class
- DateTimePlusTest
- @coversDefaultClass \Drupal\Component\Datetime\DateTimePlus @group Datetime
Namespace
Drupal\Tests\Component\DatetimeCode
public function testInvalidConstructor($time, array $errors) {
$date = new DateTimePlus($time);
$this
->assertEquals(TRUE, $date
->hasErrors());
$this
->assertEquals($errors, $date
->getErrors());
}