You are here

public function EntityModerationStateDeriverTest::getDerivativeDefinitionsProvider in Workbench Moderation to Content Moderation 8.2

Data provider for testGetDerivativeDefinitions().

Return value

array A set of test scenarios. Each is an array with the following items:

  • A set of arrays, each representing an entity type, and keyed by the entity type ID. Each array is a tuple of three boolean flags representing (in order) the revisionablity, translatability, and moderatability of the entity type. See mockEntityType() for more.
  • How many plugin definitions the deriver is expected to return.
  • The derivative IDs that the deriver is expected to return.

File

tests/src/Unit/Plugin/Deriver/EntityModerationStateDeriverTest.php, line 104

Class

EntityModerationStateDeriverTest
@coversDefaultClass \Drupal\wbm2cm\Plugin\Deriver\EntityModerationStateDeriver @group wbm2cm

Namespace

Drupal\Tests\wbm2cm\Unit\Plugin\Deriver

Code

public function getDerivativeDefinitionsProvider() {
  return [
    'compatible' => [
      [
        'foo' => [
          TRUE,
          TRUE,
          TRUE,
        ],
      ],
      1,
      [
        'foo',
      ],
    ],
    'translatable, moderatable, but not revisionable' => [
      [
        'foo' => [
          TRUE,
          TRUE,
          TRUE,
        ],
        'bar' => [
          FALSE,
          TRUE,
          TRUE,
        ],
      ],
      1,
      [
        'foo',
      ],
    ],
    'revisionable, moderatable, but not translatable' => [
      [
        'foo' => [
          TRUE,
          TRUE,
          TRUE,
        ],
        'bar' => [
          TRUE,
          FALSE,
          TRUE,
        ],
      ],
      1,
      [
        'foo',
      ],
    ],
    'revisionable, translatable, but not moderatable' => [
      [
        'foo' => [
          TRUE,
          TRUE,
          TRUE,
        ],
        'bar' => [
          TRUE,
          TRUE,
          FALSE,
        ],
      ],
      1,
      [
        'foo',
      ],
    ],
  ];
}