You are here

protected function QueueSerializationTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php \Drupal\KernelTests\Core\Queue\QueueSerializationTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php, line 78

Class

QueueSerializationTest
Tests serializing a form with an injected DatabaseQueue instance.

Namespace

Drupal\KernelTests\Core\Queue

Code

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