Mercurial > hg > cmmr2012-drupal-site
diff core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | 12f9dff5fda9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php Thu Jul 05 14:24:15 2018 +0000 @@ -0,0 +1,62 @@ +<?php + +namespace Drupal\FunctionalTests\Installer; + +use Drupal\Core\Serialization\Yaml; + +/** + * Tests distribution profile support. + * + * @group Installer + */ +class SingleVisibleProfileTest extends InstallerTestBase { + + /** + * The installation profile to install. + * + * Not needed when only one is visible. + * + * @var string + */ + protected $profile = NULL; + + /** + * {@inheritdoc} + */ + protected function prepareEnvironment() { + parent::prepareEnvironment(); + $profiles = ['standard', 'demo_umami']; + foreach ($profiles as $profile) { + $info = [ + 'type' => 'profile', + 'core' => \Drupal::CORE_COMPATIBILITY, + 'name' => 'Override ' . $profile, + 'hidden' => TRUE, + ]; + // File API functions are not available yet. + $path = $this->siteDirectory . '/profiles/' . $profile; + mkdir($path, 0777, TRUE); + file_put_contents("$path/$profile.info.yml", Yaml::encode($info)); + } + } + + /** + * {@inheritdoc} + */ + protected function setUpProfile() { + // This step is skipped, because there is only one visible profile. + } + + /** + * Confirms that the installation succeeded. + */ + public function testInstalled() { + $this->assertUrl('user/1'); + $this->assertResponse(200); + // Confirm that we are logged-in after installation. + $this->assertText($this->rootUser->getUsername()); + // Confirm that the minimal profile was installed. + $this->assertEqual(drupal_get_profile(), 'minimal'); + } + +}