3 namespace Drupal\system\Tests\Installer;
5 use Drupal\Core\Serialization\Yaml;
6 use Drupal\simpletest\InstallerTestBase;
9 * Tests distribution profile support.
13 class SingleVisibleProfileTest extends InstallerTestBase {
16 * The installation profile to install.
18 * Not needed when only one is visible.
22 protected $profile = NULL;
24 protected function setUp() {
25 $profiles = ['standard', 'demo_umami'];
26 foreach ($profiles as $profile) {
29 'core' => \Drupal::CORE_COMPATIBILITY,
30 'name' => 'Override ' . $profile,
33 // File API functions are not available yet.
34 $path = $this->siteDirectory . '/profiles/' . $profile;
35 mkdir($path, 0777, TRUE);
36 file_put_contents("$path/$profile.info.yml", Yaml::encode($info));
44 protected function setUpProfile() {
45 // This step is skipped, because there is only one visible profile.
49 * Confirms that the installation succeeded.
51 public function testInstalled() {
52 $this->assertUrl('user/1');
53 $this->assertResponse(200);
54 // Confirm that we are logged-in after installation.
55 $this->assertText($this->rootUser->getUsername());
56 // Confirm that the minimal profile was installed.
57 $this->assertEqual(drupal_get_profile(), 'minimal');