You are here

public function CommandHelperTest::testServerEnableCommand in Search API 8

Tests the server enable command.

@covers ::enableServerCommand

File

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

Class

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

Namespace

Drupal\Tests\search_api\Kernel\System

Code

public function testServerEnableCommand() {

  /** @var \Drupal\search_api\ServerInterface $server */
  $server = Server::load('test_server');
  $server
    ->setStatus(FALSE);
  $server
    ->save();
  $this->systemUnderTest
    ->enableServerCommand('test_server');
  $server = Server::load('test_server');
  $this
    ->assertTrue($server
    ->status());
  $this
    ->expectException(ConsoleException::class);
  $this->systemUnderTest
    ->enableServerCommand('foo');
}