DomainConfigPageCacheTest.php in Domain Access 8
File
domain_config/tests/src/Functional/DomainConfigPageCacheTest.php
View source
<?php
namespace Drupal\Tests\domain_config\Functional;
class DomainConfigPageCacheTest extends DomainConfigTestBase {
public static $modules = [
'domain',
'domain_config',
'domain_config_test',
'domain_config_middleware_test',
];
public function testDomainResponse() {
$this
->domainTableIsEmpty();
$this
->domainCreateTestDomains(5);
$expected = [];
$domains = \Drupal::entityTypeManager()
->getStorage('domain')
->loadMultiple(NULL, TRUE);
foreach ($domains as $domain) {
$this
->drupalGet($domain
->getPath());
$expected[] = $domain
->getPath() . ':';
}
$database = \Drupal::database();
$query = $database
->query("SELECT cid FROM {cache_page}");
$result = $query
->fetchCol();
$this
->assertEqual(sort($expected), sort($result), implode(', ', $result));
}
}