SingleVisibleProfileTest.php in Drupal 10
File
core/tests/Drupal/FunctionalTests/Installer/SingleVisibleProfileTest.php
View source
<?php
namespace Drupal\FunctionalTests\Installer;
use Drupal\Core\Serialization\Yaml;
class SingleVisibleProfileTest extends InstallerTestBase {
protected $profile = NULL;
protected $defaultTheme = 'stark';
protected function prepareEnvironment() {
parent::prepareEnvironment();
$profiles = [
'standard',
'demo_umami',
];
foreach ($profiles as $profile) {
$info = [
'type' => 'profile',
'core_version_requirement' => '^8 || ^9 || ^10',
'name' => 'Override ' . $profile,
'hidden' => TRUE,
];
$path = $this->siteDirectory . '/profiles/' . $profile;
mkdir($path, 0777, TRUE);
file_put_contents("{$path}/{$profile}.info.yml", Yaml::encode($info));
}
}
protected function setUpProfile() {
}
public function testInstalled() {
$this
->assertSession()
->addressEquals('user/1');
$this
->assertSession()
->statusCodeEquals(200);
$this
->assertSession()
->pageTextContains($this->rootUser
->getAccountName());
$this
->assertEquals('minimal', \Drupal::installProfile());
}
}