You are here

public function SchedulerEntityAccessTest::dataEntityAccess in Scheduler 2.x

Provides data for testEntityAccess.

The data in dataStandardEntityTypes() is expanded to test each entity type for both publishing and unpublishing.

Return value

array Each row has values: [entity type id, bundle id, field name, status].

File

tests/src/Functional/SchedulerEntityAccessTest.php, line 94

Class

SchedulerEntityAccessTest
Tests that Scheduler cron has full access to the scheduled entities.

Namespace

Drupal\Tests\scheduler\Functional

Code

public function dataEntityAccess() {
  $data = [];
  foreach ($this
    ->dataStandardEntityTypes() as $key => $values) {

    // Media and Commerce Products do not have a hook access and grant system
    // like Nodes so the test would fail for non-node entities.
    // @todo Investigate how scheduler_access_test module can be expanded to
    // deny access to Media and Products using another method.
    if ($values[0] == 'media' || $values[0] == 'commerce_product') {
      continue;
    }
    $data["{$key}-1"] = array_merge($values, [
      'publish_on',
      FALSE,
    ]);
    $data["{$key}-1"] = array_merge($values, [
      'unpublish_on',
      TRUE,
    ]);
  }
  return $data;
}