public function DashboardTest::testDashboardView in farmOS 2.x
Test that custom views are added to the dashboard.
File
- modules/
core/ ui/ dashboard/ tests/ src/ Functional/ DashboardTest.php, line 54
Class
- DashboardTest
- Tests the farmOS dashboard functionality.
Namespace
Drupal\Tests\farm_ui_dashboard\FunctionalCode
public function testDashboardView() {
$this
->drupalGet('/dashboard');
$this
->assertSession()
->statusCodeEquals(200);
// Assert that the test view was not added to the dashboard.
$this
->assertSession()
->pageTextNotContains('User list');
$this
->assertSession()
->pageTextNotContains($this->user
->getAccountName());
$user = $this
->createUser([
'access farm dashboard',
'access user profiles',
]);
$this
->drupalLogin($user);
$this
->drupalGet('/dashboard');
$this
->assertSession()
->statusCodeEquals(200);
// Assert that the test view was added to the dashboard.
$this
->assertSession()
->pageTextContains('User list');
$this
->assertSession()
->pageTextContains($user
->getAccountName());
}