public function FrontPageTest::testAdminFrontPage in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/node/src/Tests/Views/FrontPageTest.php \Drupal\node\Tests\Views\FrontPageTest::testAdminFrontPage()
Tests the frontpage when logged in as admin.
File
- core/
modules/ node/ src/ Tests/ Views/ FrontPageTest.php, line 176 - Contains \Drupal\node\Tests\Views\FrontPageTest.
Class
- FrontPageTest
- Tests the default frontpage provided by views.
Namespace
Drupal\node\Tests\ViewsCode
public function testAdminFrontPage() {
// When a user with sufficient permissions is logged in, views_ui adds
// contextual links to the homepage view. This verifies there are no errors.
\Drupal::service('module_installer')
->install(array(
'views_ui',
));
// Login root user with sufficient permissions.
$this
->drupalLogin($this->rootUser);
// Test frontpage view.
$this
->drupalGet('node');
$this
->assertResponse(200);
// Check that the frontpage view was rendered.
$this
->assertPattern('/class=".+view-frontpage/', 'Frontpage view was rendered');
}