You are here

protected property ModerationDashboardPersonalizedComponentsTest::$personalizedModerationElements in Moderation Dashboard 2.0.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/ModerationDashboardPersonalizedComponentsTest.php \Drupal\Tests\moderation_dashboard\Functional\ModerationDashboardPersonalizedComponentsTest::personalizedModerationElements

Personalized elements to test.

An array of text asserts keyed by the CSS selector of the element to assert.

  • contains: array of strings patters which have to be found. '%s' will be replaced by the display name of the user in context.
  • not_contains: array of strings patterns shouldn't be found. '%s' will be replaced by the display name of the user in context.
  • empty: the expected empty message of the component (string).

Type: array

File

tests/src/Functional/ModerationDashboardPersonalizedComponentsTest.php, line 38

Class

ModerationDashboardPersonalizedComponentsTest
Tests personalized moderation dashboard components.

Namespace

Drupal\Tests\moderation_dashboard\Functional

Code

protected $personalizedModerationElements = [
  // Your drafts.
  '.view-id-content_moderation_dashboard_in_review.view-display-id-block_3' => [
    'contains' => [
      'Draft node of %s',
    ],
    'not_contains' => [
      'Published node of %s',
    ],
    'empty' => 'No draft content was found.',
  ],
  // Your activity.
  '.view-id-moderation_dashboard_recent_changes.view-display-id-block_2' => [
    'contains' => [
      'Published node of %s',
      'Draft node of %s',
    ],
    'empty' => 'Activity log is empty.',
  ],
  // Content you created.
  '.view-id-moderation_dashboard_recently_created.view-display-id-block_2' => [
    'contains' => [
      'Published node of %s',
      'Draft node of %s',
    ],
    'empty' => 'No content was found.',
  ],
];