You are here

protected function WorkspaceTestUtilities::isLabelInContentOverview in Drupal 9

Same name and namespace in other branches
  1. 8 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 169

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);
}