You are here

protected function ServerTaskTest::getServerTasks in Search API 8

Retrieves the tasks set on the test server.

Return value

object[] All tasks read from the database for the test server, with numeric keys starting with 0.

5 calls to ServerTaskTest::getServerTasks()
ServerTaskTest::testAddIndex in tests/src/Kernel/Server/ServerTaskTest.php
Tests task system integration for the server's addIndex() method.
ServerTaskTest::testDeleteAllIndexItems in tests/src/Kernel/Server/ServerTaskTest.php
Tests task system integration for the deleteAllIndexItems() method.
ServerTaskTest::testDeleteItems in tests/src/Kernel/Server/ServerTaskTest.php
Tests task system integration for the server's deleteItems() method.
ServerTaskTest::testRemoveIndex in tests/src/Kernel/Server/ServerTaskTest.php
Tests task system integration for the server's removeIndex() method.
ServerTaskTest::testUpdateIndex in tests/src/Kernel/Server/ServerTaskTest.php
Tests task system integration for the server's updateIndex() method.

File

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

Class

ServerTaskTest
Tests whether the server task system works correctly.

Namespace

Drupal\Tests\search_api\Kernel\Server

Code

protected function getServerTasks() {
  $tasks = [];
  $select = \Drupal::database()
    ->select('search_api_task', 't');
  $select
    ->fields('t')
    ->orderBy('id')
    ->condition('server_id', $this->server
    ->id());
  foreach ($select
    ->execute() as $task) {
    if ($task->data) {
      $task->data = unserialize($task->data);
    }
    $tasks[] = $task;
  }
  return $tasks;
}