function QueueSerializationTest::setUp

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php \Drupal\KernelTests\Core\Queue\QueueSerializationTest::setUp()
  2. 10 core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php \Drupal\KernelTests\Core\Queue\QueueSerializationTest::setUp()
  3. 11.x 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 76

Class

QueueSerializationTest
Tests serializing a form with an injected DatabaseQueue instance.

Namespace

Drupal\KernelTests\Core\Queue

Code

protected function setUp() : void {
    parent::setUp();
    $this->installSchema('system', [
        'sequences',
    ]);
    $this->installEntitySchema('user');
    // We only need a valid \Drupal\Core\Queue\DatabaseQueue object here, not
    // an actual valid queue.
    $this->queue = \Drupal::service('queue.database')->get('fake_a_queue');
    $test_user = User::create([
        'name' => 'foobar',
        'mail' => 'foobar@example.com',
    ]);
    $test_user->save();
    \Drupal::service('current_user')->setAccount($test_user);
}

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