You are here

public function HookImplementationTest::hideSchedulerFieldsProvider in Scheduler content moderation integration 8

Data provider for self:testHookHideSchedulerFields().

File

tests/src/Kernel/HookImplementationTest.php, line 68

Class

HookImplementationTest
Tests the Scheduler hook functions implemented by this module.

Namespace

Drupal\Tests\scheduler_content_moderation_integration\Kernel

Code

public function hideSchedulerFieldsProvider() {
  return [
    // Two states in addition to _none. Should not hide the fields.
    [
      FALSE,
      'moderatedNode',
      [
        '_none' => 'None',
        'Some state',
        'Not hidden',
      ],
    ],
    // Just one state in addition to _none. Should not hide the fields.
    [
      FALSE,
      'moderatedNode',
      [
        '_none' => 'Nothing',
        'Will not be hidden',
      ],
    ],
    // Just one state, does not include _none. Should not hide the fields.
    [
      FALSE,
      'moderatedNode',
      [
        'The only state',
      ],
    ],
    // The only state is 'None'. This should cause the fields to be hidden.
    [
      TRUE,
      'moderatedNode',
      [
        '_none' => 'Nothing',
      ],
    ],
    // No states at all. This should cause the fields to be hidden.
    [
      TRUE,
      'moderatedNode',
      [],
    ],
    // Content type is not moderated. Should not hide the fields.
    [
      FALSE,
      'nonModeratedNode',
      [
        '_none' => 'Nothing',
      ],
    ],
  ];
}