function WorkspaceTestUtilities::isLabelInContentOverview

Same name in other branches
  1. 9 core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::isLabelInContentOverview()
  2. 8.9.x core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::isLabelInContentOverview()
  3. 11.x core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php \Drupal\Tests\workspaces\Functional\WorkspaceTestUtilities::isLabelInContentOverview()

Determine if the content list has an entity's label.

This assertion can be used to validate a particular entity exists in the current workspace.

File

core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php, line 198

Class

WorkspaceTestUtilities
Utility methods for use in BrowserTestBase tests.

Namespace

Drupal\Tests\workspaces\Functional

Code

protected function isLabelInContentOverview($label) {
    $this->drupalGet('/admin/content');
    $session = $this->getSession();
    $this->assertSession()
        ->statusCodeEquals(200);
    $page = $session->getPage();
    return $page->hasContent($label);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.