Chris@16: info = [ Chris@16: 'type' => 'profile', Chris@16: 'core' => \Drupal::CORE_COMPATIBILITY, Chris@16: 'name' => 'Distribution profile', Chris@16: 'distribution' => [ Chris@16: 'name' => 'My Distribution', Chris@16: 'install' => [ Chris@16: 'theme' => 'bartik', Chris@17: 'finish_url' => '/myrootuser', Chris@16: ], Chris@16: ], Chris@16: ]; Chris@16: // File API functions are not available yet. Chris@16: $path = $this->siteDirectory . '/profiles/mydistro'; Chris@16: mkdir($path, 0777, TRUE); Chris@16: file_put_contents("$path/mydistro.info.yml", Yaml::encode($this->info)); Chris@17: file_put_contents("$path/mydistro.install", "save('/user/1', '/myrootuser');}"); Chris@16: } Chris@16: Chris@16: /** Chris@16: * {@inheritdoc} Chris@16: */ Chris@16: protected function setUpLanguage() { Chris@16: // Verify that the distribution name appears. Chris@16: $this->assertRaw($this->info['distribution']['name']); Chris@16: // Verify that the distribution name is used in the site title. Chris@16: $this->assertTitle('Choose language | ' . $this->info['distribution']['name']); Chris@16: // Verify that the requested theme is used. Chris@16: $this->assertRaw($this->info['distribution']['install']['theme']); Chris@16: // Verify that the "Choose profile" step does not appear. Chris@16: $this->assertNoText('profile'); Chris@16: Chris@16: parent::setUpLanguage(); Chris@16: } Chris@16: Chris@16: /** Chris@16: * {@inheritdoc} Chris@16: */ Chris@16: protected function setUpProfile() { Chris@16: // This step is skipped, because there is a distribution profile. Chris@16: } Chris@16: Chris@16: /** Chris@16: * Confirms that the installation succeeded. Chris@16: */ Chris@16: public function testInstalled() { Chris@17: $this->assertUrl('myrootuser'); Chris@16: $this->assertResponse(200); Chris@16: // Confirm that we are logged-in after installation. Chris@18: $this->assertText($this->rootUser->getAccountName()); Chris@16: Chris@16: // Confirm that Drupal recognizes this distribution as the current profile. Chris@16: $this->assertEqual(\Drupal::installProfile(), 'mydistro'); Chris@16: $this->assertEqual($this->config('core.extension')->get('profile'), 'mydistro', 'The install profile has been written to core.extension configuration.'); Chris@16: } Chris@16: Chris@16: }