install(['bartik']); } /** * Tests the handling of an inbound request. */ public function testDomainNegotiator() { // No domains should exist. $this->domainTableIsEmpty(); // Create four new domains programmatically. $this->domainCreateTestDomains(4); // The test runner doesn't use a theme that contains the preprocess hook, // so set to use Bartik. $config = $this->config('system.theme'); $config->set('default', 'bartik')->save(); // Test the response of the default home page. foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { $this->drupalGet($domain->getPath()); $text = 'id() . '-class'); $this->assertRaw($text, 'Custom CSS present.' . $text); } // Set the css classes. $config = $this->config('domain.settings'); $config->set('css_classes', '[domain:machine-name]-class [domain:name]-class')->save(); // Test the response of the default home page. foreach (\Drupal::entityTypeManager()->getStorage('domain')->loadMultiple() as $domain) { // The render cache trips up this test. In production, it may be // necessary to add the url.site cache context. See README.md. drupal_flush_all_caches(); $this->drupalGet($domain->getPath()); $text = '