You are here

public function SchedulerMultilingualTest::dataPublishingTranslations in Scheduler 8

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

Provides data for testPublishingTranslations().

Case 1 when the date is translatable and can differ between translations. Case 2 when the date is not translatable and the behavior should be consistent over all translations.

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 272

Class

SchedulerMultilingualTest
Tests the scheduling functions for node translations.

Namespace

Drupal\Tests\scheduler\Functional

Code

public function dataPublishingTranslations() {

  // The key text relates to which fields are translatable.
  return [
    '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,
      [],
      [],
    ],
  ];
}