3 namespace Drupal\FunctionalTests\Installer;
5 use Drupal\Core\Serialization\Yaml;
8 * Tests distribution profile support.
12 class SingleVisibleProfileTest extends InstallerTestBase {
15 * The installation profile to install.
17 * Not needed when only one is visible.
21 protected $profile = NULL;
26 protected function prepareEnvironment() {
27 parent::prepareEnvironment();
28 $profiles = ['standard', 'demo_umami'];
29 foreach ($profiles as $profile) {
32 'core' => \Drupal::CORE_COMPATIBILITY,
33 'name' => 'Override ' . $profile,
36 // File API functions are not available yet.
37 $path = $this->siteDirectory . '/profiles/' . $profile;
38 mkdir($path, 0777, TRUE);
39 file_put_contents("$path/$profile.info.yml", Yaml::encode($info));
46 protected function setUpProfile() {
47 // This step is skipped, because there is only one visible profile.
51 * Confirms that the installation succeeded.
53 public function testInstalled() {
54 $this->assertUrl('user/1');
55 $this->assertResponse(200);
56 // Confirm that we are logged-in after installation.
57 $this->assertText($this->rootUser->getUsername());
58 // Confirm that the minimal profile was installed.
59 $this->assertEqual(drupal_get_profile(), 'minimal');