You are here

public function CommandHelperTest::testClearServerCommand in Search API 8

Tests the clear server command.

@covers ::clearServerCommand

File

tests/src/Kernel/System/CommandHelperTest.php, line 345

Class

CommandHelperTest
Tests Search API functionality that gets executed by console utilities.

Namespace

Drupal\Tests\search_api\Kernel\System

Code

public function testClearServerCommand() {

  /** @var \Drupal\search_api\IndexInterface $index */
  $index = Index::load('test_index');
  $this
    ->assertSame(5, $index
    ->getTrackerInstance()
    ->getIndexedItemsCount());
  $this->systemUnderTest
    ->clearServerCommand('test_server');
  $this
    ->assertSame(0, $index
    ->getTrackerInstance()
    ->getIndexedItemsCount());
}