public function DateTimePlusTest::testInvalidConstructor in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidConstructor()
- 9 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 757
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());
}