class SiteNameTest
Same name and namespace in other branches
- 11.x core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php \Drupal\FunctionalTests\Installer\SiteNameTest
- 10 core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php \Drupal\FunctionalTests\Installer\SiteNameTest
- 8.9.x core/tests/Drupal/FunctionalTests/Installer/SiteNameTest.php \Drupal\FunctionalTests\Installer\SiteNameTest
Tests that the site name can be set during a non-interactive installation.
@group Installer
Hierarchy
- class \Drupal\Tests\BrowserTestBase uses \Drupal\Core\Test\FunctionalTestSetupTrait, \Drupal\Tests\UiHelperTrait, \Drupal\Core\Test\TestSetupTrait, \Drupal\Tests\block\Traits\BlockCreationTrait, \Drupal\FunctionalTests\AssertLegacyTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\node\Traits\NodeCreationTrait, \Drupal\Tests\node\Traits\ContentTypeCreationTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\user\Traits\UserCreationTrait, \Drupal\Tests\XdebugRequestTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, \Drupal\Tests\ExtensionListTestTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\FunctionalTests\Installer\SiteNameTest implements \Drupal\Tests\BrowserTestBase
Expanded class hierarchy of SiteNameTest
File
-
core/
tests/ Drupal/ FunctionalTests/ Installer/ SiteNameTest.php, line 12
Namespace
Drupal\FunctionalTests\InstallerView source
class SiteNameTest extends BrowserTestBase {
/**
* The site name to be used when testing.
*
* @var string
*/
protected $siteName;
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function installParameters() {
$this->siteName = $this->randomMachineName();
$parameters = parent::installParameters();
$parameters['forms']['install_configure_form']['site_name'] = $this->siteName;
return $parameters;
}
/**
* Tests that the desired site name appears on the page after installation.
*/
public function testSiteName() {
$this->drupalGet('');
$this->assertSession()
->pageTextContains($this->siteName);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.