You are here

protected function DurationFormElementTest::setUp in Duration Field 8.2

Same name and namespace in other branches
  1. 3.0.x tests/src/Kernel/DurationFormElementTest.php \Drupal\Tests\duration_field\Kernel\DurationFormElementTest::setUp()

Sets up the test.

Overrides KernelTestBase::setUp

File

tests/src/Kernel/DurationFormElementTest.php, line 35

Class

DurationFormElementTest
Tests the 'duration' form element.

Namespace

Drupal\Tests\duration_field\Kernel

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('system', [
    'sequences',
    'key_value_expire',
  ]);
  $this
    ->installEntitySchema('user');
  \Drupal::service('router.builder')
    ->rebuild();
  $this->testUser = User::create([
    'name' => 'foobar',
    'mail' => 'foobar@example.com',
  ]);
  $this->testUser
    ->save();
  \Drupal::service('current_user')
    ->setAccount($this->testUser);
}