function DateFormatValidationTest::setUp

Same name in other branches
  1. 10 core/tests/Drupal/KernelTests/Core/Entity/DateFormatValidationTest.php \Drupal\KernelTests\Core\Entity\DateFormatValidationTest::setUp()

Overrides ConfigEntityValidationTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Entity/DateFormatValidationTest.php, line 21

Class

DateFormatValidationTest
Tests validation of date_format entities.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
    parent::setUp();
    $this->entity = DateFormat::create([
        'id' => 'test',
        'label' => 'Test',
        'pattern' => 'Y-m-d',
    ]);
    $this->entity
        ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.