SiteNameTest.php 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 $defaultTheme = 'stark';
  20. /**
  21. * {@inheritdoc}
  22. */
  23. protected function installParameters() {
  24. $this->siteName = $this->randomMachineName();
  25. $parameters = parent::installParameters();
  26. $parameters['forms']['install_configure_form']['site_name'] = $this->siteName;
  27. return $parameters;
  28. }
  29. /**
  30. * Tests that the desired site name appears on the page after installation.
  31. */
  32. public function testSiteName() {
  33. $this->drupalGet('');
  34. $this->assertRaw($this->siteName, 'The site name that was set during the installation appears on the front page after installation.');
  35. }
  36. }