DistributionProfileTest.php in Zircon Profile 8.0
File
core/modules/system/src/Tests/Installer/DistributionProfileTest.php
View source
<?php
namespace Drupal\system\Tests\Installer;
use Drupal\Component\Serialization\Yaml;
use Drupal\simpletest\InstallerTestBase;
class DistributionProfileTest extends InstallerTestBase {
protected $info;
protected function setUp() {
$this->info = array(
'type' => 'profile',
'core' => \Drupal::CORE_COMPATIBILITY,
'name' => 'Distribution profile',
'distribution' => array(
'name' => 'My Distribution',
'install' => array(
'theme' => 'bartik',
),
),
);
$path = $this->siteDirectory . '/profiles/mydistro';
mkdir($path, 0777, TRUE);
file_put_contents("{$path}/mydistro.info.yml", Yaml::encode($this->info));
parent::setUp();
}
protected function setUpLanguage() {
$this
->assertRaw($this->info['distribution']['name']);
$this
->assertRaw($this->info['distribution']['install']['theme']);
$this
->assertNoText('profile');
parent::setUpLanguage();
}
protected function setUpProfile() {
}
public function testInstalled() {
$this
->assertUrl('user/1');
$this
->assertResponse(200);
$this
->assertText($this->rootUser
->getUsername());
}
}