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;
25 * The install profile info.
31 protected function setUp() {
34 'core' => \Drupal::CORE_COMPATIBILITY,
35 'name' => 'Override standard',
38 // File API functions are not available yet.
39 $path = $this->siteDirectory . '/profiles/standard';
40 mkdir($path, 0777, TRUE);
41 file_put_contents("$path/standard.info.yml", Yaml::encode($this->info));
49 protected function setUpProfile() {
50 // This step is skipped, because there is only one visible profile.
54 * Confirms that the installation succeeded.
56 public function testInstalled() {
57 $this->assertUrl('user/1');
58 $this->assertResponse(200);
59 // Confirm that we are logged-in after installation.
60 $this->assertText($this->rootUser->getUsername());
61 // Confirm that the minimal profile was installed.
62 $this->assertEqual(drupal_get_profile(), 'minimal');