You are here

protected function TestTrait::initializeQueueService in Purge 8.3

Make $this->purgeQueue available.

Parameters

null|string[] $plugin_id: The plugin ID of the queue to be configured.

bool $write_empty: Write empty plugin configuration.

3 calls to TestTrait::initializeQueueService()
QueueBrowserFormTest::testData in modules/purge_ui/tests/src/Functional/Form/QueueBrowserFormTest.php
Tests that data is shown accordingly.
QueueDetailsFormTest::setUp in modules/purge_ui/tests/src/Functional/Form/QueueDetailsFormTest.php
Setup the test.
QueueEmptyFormTest::testConfirm in modules/purge_ui/tests/src/Functional/Form/QueueEmptyFormTest.php
Tests that the confirm button clears the queue.

File

tests/src/Traits/TestTrait.php, line 155

Class

TestTrait
Several helper properties and methods for purge tests.

Namespace

Drupal\Tests\purge\Traits

Code

protected function initializeQueueService($plugin_id = NULL, $write_empty = FALSE) : void {
  if (is_null($this->purgeQueue)) {
    $this->purgeQueue = $this->container
      ->get('purge.queue');
  }
  $plugin_ids = is_null($plugin_id) ? [] : [
    $plugin_id,
  ];
  if (count($plugin_ids) || $write_empty) {
    $this->purgeQueue
      ->reload();
    $this->purgeQueue
      ->setPluginsEnabled($plugin_ids);
  }
}