Skip to content
Snippets Groups Projects
Commit 618cbedb authored by James Scott's avatar James Scott
Browse files

Initial test

parent 9368579f
No related branches found
No related tags found
No related merge requests found
......@@ -10,14 +10,18 @@ use Drupal\Tests\BrowserTestBase;
*
* @group user_history
*/
class LoadTest extends BrowserTestBase {
class LoadFrontPageTest extends BrowserTestBase {
/**
* Modules to enable.
*
* @var array
*/
public static $modules = ['user_history'];
public static $modules = [
'user_history',
'node',
'views',
];
/**
* A user with permission to administer site configuration.
......@@ -26,21 +30,33 @@ class LoadTest extends BrowserTestBase {
*/
protected $user;
/**
* The default theme to use with the test
* @var string
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($this->user);
// Set the front page to "/node".
\Drupal::configFactory()
->getEditable('system.site')
->set('page.front', '/node')
->save(TRUE);
}
/**
* Tests that the home page loads with a 200 response.
*/
public function testLoad() {
public function testLoadFrontPage() {
$this->drupalGet(Url::fromRoute('<front>'));
// Confirm that the page loaded correctly
$this->assertSession()->statusCodeEquals(200);
// Confirm that the front page contains the standard text.
$this->assertText('Welcome to Drupal');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment