You are here

public function ServerStorageTest::serverUpdate in Search API 8

Tests whether updating a server works correctly.

Parameters

\Drupal\search_api\ServerInterface $server: The server used for this test.

1 call to ServerStorageTest::serverUpdate()
ServerStorageTest::testServerCrud in tests/src/Kernel/Server/ServerStorageTest.php
Tests all CRUD operations as a queue of operations.

File

tests/src/Kernel/Server/ServerStorageTest.php, line 108

Class

ServerStorageTest
Tests whether the storage of search servers works correctly.

Namespace

Drupal\Tests\search_api\Kernel\Server

Code

public function serverUpdate(ServerInterface $server) {
  $server
    ->set('name', $server
    ->label() . ' - edited');
  $server
    ->save();
  $methods_called = $this
    ->getCalledMethods('backend');
  $this
    ->assertContains('preUpdate', $methods_called, 'Backend::preUpdate() called for update.');
  $this
    ->assertContains('postUpdate', $methods_called, 'Backend::postUpdate() called for update.');
  $this
    ->serverLoad($server);
}