function DateTimePlusTest::testInvalidConstructor
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidConstructor()
- 8.9.x core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php \Drupal\Tests\Component\Datetime\DateTimePlusTest::testInvalidConstructor()
- 10 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 760
Class
- DateTimePlusTest
- @coversDefaultClass \Drupal\Component\Datetime\DateTimePlus @group Datetime
Namespace
Drupal\Tests\Component\DatetimeCode
public function testInvalidConstructor($time, array $errors) : void {
$date = new DateTimePlus($time);
$this->assertEquals(TRUE, $date->hasErrors());
$this->assertEquals($errors, $date->getErrors());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.