You are here

public function SchedulerNonEnabledTypeTest::dataNonEnabledType in Scheduler 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SchedulerNonEnabledTypeTest.php \Drupal\Tests\scheduler\Functional\SchedulerNonEnabledTypeTest::dataNonEnabledType()

Provides data for testNonEnabledType().

Return value

array Each item in the test data array has the follow elements: id - (in) a sequential id for use in node titles description - (string) describing the scenario being checked publishing_enabled - (bool) whether publishing is enabled unpublishing_enabled - (bool) whether unpublishing is enabled

File

tests/src/Functional/SchedulerNonEnabledTypeTest.php, line 127

Class

SchedulerNonEnabledTypeTest
Tests a content type which is not enabled for scheduling.

Namespace

Drupal\Tests\scheduler\Functional

Code

public function dataNonEnabledType() {
  $data = [
    // By default check that the scheduler date fields are not displayed.
    0 => [
      0,
      'Default',
      FALSE,
      FALSE,
    ],
    // Explicitly disable this content type for both settings.
    1 => [
      1,
      'Disabling both settings',
      FALSE,
      FALSE,
    ],
    // Turn on scheduled publishing only.
    2 => [
      2,
      'Enabling publishing only',
      TRUE,
      FALSE,
    ],
    // Turn on scheduled unpublishing only.
    3 => [
      3,
      'Enabling unpublishing only',
      FALSE,
      TRUE,
    ],
    // For completeness turn on bothbscheduled publishing and unpublishing.
    4 => [
      4,
      'Enabling both publishing and unpublishing',
      TRUE,
      TRUE,
    ],
  ];

  // Use unset($data[n]) to remove a temporarily unwanted item, use
  // return [$data[n]] to selectively test just one item, or have the
  // default return $data to test everything.
  return $data;
}