You are here

public function DomainTestTrait::prepareTrustedHostname in Domain Access 8

Converts a domain hostname to a trusted host pattern.

Parameters

string $hostname: A hostname string.

Return value

string A regex-safe hostname, without delimiters.

2 calls to DomainTestTrait::prepareTrustedHostname()
DomainInactiveTest::testInactiveDomain in domain/tests/src/Functional/DomainInactiveTest.php
Test inactive domain.
DomainSourceTrustedHostTest::testDomainSourceUrls in domain_source/tests/src/Functional/DomainSourceTrustedHostTest.php
Tests domain source URLs.

File

domain/tests/src/Traits/DomainTestTrait.php, line 131

Class

DomainTestTrait
Contains helper classes for tests to set up various configuration.

Namespace

Drupal\Tests\domain\Traits

Code

public function prepareTrustedHostname($hostname) {
  $hostname = mb_strtolower(preg_replace('/:\\d+$/', '', trim($hostname)));
  return preg_quote($hostname);
}