You are here

public function SchedulerMultilingualTest::dataPublishingTranslations in Scheduler 2.x

Same name and namespace in other branches
  1. 8 tests/src/Functional/SchedulerMultilingualTest.php \Drupal\Tests\scheduler\Functional\SchedulerMultilingualTest::dataPublishingTranslations()

Provides data for testPublishingTranslations().

Case 1 when the dates are translatable and can differ between translations. Case 2 when the dates are not translatable and the behavior should be consistent over all translations. Case 3 - 8 when there are differences in the settings and the validation should prevent the form being saved.

Return value

array The test data. Each array element has the format: Publish_on translatable Unublish_on translatable Status translatable Expected status of four translations before cron Expected status of four translations after cron

File

tests/src/Functional/SchedulerMultilingualTest.php, line 273

Class

SchedulerMultilingualTest
Tests the scheduling functions for node translations.

Namespace

Drupal\Tests\scheduler\Functional

Code

public function dataPublishingTranslations() {

  // The key text is just for info, and shows which fields are translatable.
  $data = [
    'all fields' => [
      TRUE,
      TRUE,
      TRUE,
      [
        FALSE,
        TRUE,
        FALSE,
        FALSE,
      ],
      [
        FALSE,
        TRUE,
        FALSE,
        TRUE,
      ],
    ],
    'no fields' => [
      FALSE,
      FALSE,
      FALSE,
      [
        FALSE,
        FALSE,
        FALSE,
        FALSE,
      ],
      [
        TRUE,
        TRUE,
        TRUE,
        TRUE,
      ],
    ],
    'only publish_on' => [
      TRUE,
      FALSE,
      FALSE,
      [],
      [],
    ],
    'only unpublish_on' => [
      FALSE,
      TRUE,
      FALSE,
      [],
      [],
    ],
    'only status' => [
      FALSE,
      FALSE,
      TRUE,
      [],
      [],
    ],
    'publish_on and unpublish_on' => [
      TRUE,
      TRUE,
      FALSE,
      [],
      [],
    ],
    'publish_on and status' => [
      TRUE,
      FALSE,
      TRUE,
      [],
      [],
    ],
    'unpublish_on and status' => [
      FALSE,
      TRUE,
      TRUE,
      [],
      [],
    ],
  ];
  return $data;
}