Chris@0: 'profile', Chris@0: 'core' => \Drupal::CORE_COMPATIBILITY, Chris@0: 'name' => $name . ' profile', Chris@0: 'distribution' => [ Chris@0: 'name' => $name, Chris@0: 'install' => [ Chris@0: 'theme' => 'bartik', Chris@0: ], Chris@0: ], Chris@0: ]; Chris@0: // File API functions are not available yet. Chris@0: $path = $this->siteDirectory . '/profiles/' . $name; Chris@0: mkdir($path, 0777, TRUE); Chris@0: file_put_contents("$path/$name.info.yml", Yaml::encode($info)); Chris@0: } Chris@0: // Install the first distribution. Chris@0: $this->profile = 'distribution_one'; Chris@0: Chris@0: parent::setUp(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function setUpLanguage() { Chris@0: // Verify that the distribution name appears. Chris@0: $this->assertRaw('distribution_one'); Chris@0: // Verify that the requested theme is used. Chris@0: $this->assertRaw('bartik'); Chris@0: // Verify that the "Choose profile" step does not appear. Chris@0: $this->assertNoText('profile'); Chris@0: Chris@0: parent::setUpLanguage(); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: protected function setUpProfile() { Chris@0: // This step is skipped, because there is a distribution profile. Chris@0: } Chris@0: Chris@0: /** Chris@0: * Confirms that the installation succeeded. Chris@0: */ Chris@0: public function testInstalled() { Chris@0: $this->assertUrl('user/1'); Chris@0: $this->assertResponse(200); Chris@0: // Confirm that we are logged-in after installation. Chris@0: $this->assertText($this->rootUser->getUsername()); Chris@0: Chris@0: // Confirm that Drupal recognizes this distribution as the current profile. Chris@0: $this->assertEqual(\Drupal::installProfile(), 'distribution_one'); Chris@0: $this->assertEqual(Settings::get('install_profile'), 'distribution_one', 'The install profile has been written to settings.php.'); Chris@0: $this->assertEqual($this->config('core.extension')->get('profile'), 'distribution_one', 'The install profile has been written to core.extension configuration.'); Chris@0: Chris@0: $this->rebuildContainer(); Chris@0: $this->pass('Container can be rebuilt as distribution is written to configuration.'); Chris@0: $this->assertEqual(\Drupal::installProfile(), 'distribution_one'); Chris@0: } Chris@0: Chris@0: }