You are here

public function DomainHookTest::testHookDomainOperations in Domain Access 8

Tests domain operations hook.

File

domain/tests/src/Kernel/DomainHookTest.php, line 133

Class

DomainHookTest
Tests domain hooks documented in domain.api.php.

Namespace

Drupal\Tests\domain\Kernel

Code

public function testHookDomainOperations() {
  $domain = $this->domainStorage
    ->load($this->key);

  // Set the request.
  $operations = $this->moduleHandler
    ->invokeAll('domain_operations', [
    $domain,
    $this->currentUser,
  ]);

  // Test that our operations were added by the hook.
  $this
    ->assertArrayHasKey('domain_test', $operations, 'Domain test operation loaded.');
}