SiteNameTest.php 924 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Drupal\FunctionalTests\Installer;
  3. use Drupal\Tests\BrowserTestBase;
  4. /**
  5. * Tests that the site name can be set during a non-interactive installation.
  6. *
  7. * @group Installer
  8. */
  9. class SiteNameTest extends BrowserTestBase {
  10. /**
  11. * The site name to be used when testing.
  12. *
  13. * @var string
  14. */
  15. protected $siteName;
  16. /**
  17. * {@inheritdoc}
  18. */
  19. protected function installParameters() {
  20. $this->siteName = $this->randomMachineName();
  21. $parameters = parent::installParameters();
  22. $parameters['forms']['install_configure_form']['site_name'] = $this->siteName;
  23. return $parameters;
  24. }
  25. /**
  26. * Tests that the desired site name appears on the page after installation.
  27. */
  28. public function testSiteName() {
  29. $this->drupalGet('');
  30. $this->assertRaw($this->siteName, 'The site name that was set during the installation appears on the front page after installation.');
  31. }
  32. }