function QueueSerializationTest::setUp
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php \Drupal\KernelTests\Core\Queue\QueueSerializationTest::setUp()
- 8.9.x core/tests/Drupal/KernelTests/Core/Queue/QueueSerializationTest.php \Drupal\KernelTests\Core\Queue\QueueSerializationTest::setUp()
- 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 77
Class
- QueueSerializationTest
- Tests serializing a form with an injected DatabaseQueue instance.
Namespace
Drupal\KernelTests\Core\QueueCode
protected function setUp() : void {
parent::setUp();
$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.