You are here

protected function ServerTaskTest::addTasks in Search API 8

Adds one task of each type for this test's server.

Parameters

\Drupal\search_api\IndexInterface $second_index: A second index, for which one additional "addIndex" task is created.

1 call to ServerTaskTest::addTasks()
ServerTaskTest::testAutomaticTaskRemoval in tests/src/Kernel/Server/ServerTaskTest.php
Tests the correct automatic removal of tasks upon certain operations.

File

tests/src/Kernel/Server/ServerTaskTest.php, line 432

Class

ServerTaskTest
Tests whether the server task system works correctly.

Namespace

Drupal\Tests\search_api\Kernel\Server

Code

protected function addTasks(IndexInterface $second_index) {
  $this->taskManager
    ->addTask('addIndex', $this->server, $second_index);
  $this->taskManager
    ->addTask('removeIndex', $this->server, $this->index);
  $this->taskManager
    ->addTask('addIndex', $this->server, $this->index);
  $this->taskManager
    ->addTask('updateIndex', $this->server, $this->index);
  $this->taskManager
    ->addTask('deleteItems', $this->server, $this->index, []);
  $this->taskManager
    ->addTask('deleteAllIndexItems', $this->server, $this->index);
}