public function SchedulerNonEnabledTypeTest::dataNonEnabledType in Scheduler 2.x
Same name and namespace in other branches
- 8 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 - (int) a sequential id for use in titles entityTypeId - (string) 'node', 'media' or 'commerce_product' 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 162
Class
- SchedulerNonEnabledTypeTest
- Tests entity types which are not enabled for scheduling.
Namespace
Drupal\Tests\scheduler\FunctionalCode
public function dataNonEnabledType() {
$data = [];
foreach ($this
->dataStandardEntityTypes() as $key => $values) {
$entityTypeId = $values[0];
// By default check that the scheduler date fields are not displayed.
$data["{$key}-1"] = [
1,
$entityTypeId,
'Default',
FALSE,
FALSE,
];
// Explicitly disable this content type for both settings.
$data["{$key}-2"] = [
2,
$entityTypeId,
'Disabling both settings',
FALSE,
FALSE,
];
// Turn on scheduled publishing only.
$data["{$key}-3"] = [
3,
$entityTypeId,
'Enabling publishing only',
TRUE,
FALSE,
];
// Turn on scheduled unpublishing only.
$data["{$key}-4"] = [
4,
$entityTypeId,
'Enabling unpublishing only',
FALSE,
TRUE,
];
// For completeness turn on both scheduled publishing and unpublishing.
$data["{$key}-5"] = [
5,
$entityTypeId,
'Enabling both publishing and unpublishing',
TRUE,
TRUE,
];
}
return $data;
}