You are here

public function CommandHelperTest::testEnableIndexWithNoIndexes in Search API 8

Tests the enable index command.

@covers ::enableIndexCommand

File

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

Class

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

Namespace

Drupal\Tests\search_api\Kernel\System

Code

public function testEnableIndexWithNoIndexes() {

  /** @var \Drupal\search_api\IndexInterface[] $indexes */
  $indexes = Index::loadMultiple();
  foreach ($indexes as $index) {
    $index
      ->delete();
  }
  $this
    ->expectException(ConsoleException::class);
  $this->systemUnderTest
    ->enableIndexCommand([
    'second_index',
  ]);
}