You are here

public function StateTransitionValidationTest::userTransitionsProvider in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php \Drupal\Tests\content_moderation\Unit\StateTransitionValidationTest::userTransitionsProvider()
  2. 10 core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php \Drupal\Tests\content_moderation\Unit\StateTransitionValidationTest::userTransitionsProvider()

Data provider for the user transition test.

File

core/modules/content_moderation/tests/src/Unit/StateTransitionValidationTest.php, line 113

Class

StateTransitionValidationTest
@coversDefaultClass \Drupal\content_moderation\StateTransitionValidation @group content_moderation

Namespace

Drupal\Tests\content_moderation\Unit

Code

public function userTransitionsProvider() {

  // The user has the right permission, so let it through.
  $ret[] = [
    'draft',
    'draft',
    'use process transition draft',
    TRUE,
    TRUE,
  ];

  // The user doesn't have the right permission, block it.
  $ret[] = [
    'draft',
    'draft',
    'use process transition draft',
    FALSE,
    FALSE,
  ];

  // The user has some other permission that doesn't matter.
  $ret[] = [
    'draft',
    'draft',
    'use process transition review',
    TRUE,
    FALSE,
  ];
  return $ret;
}