You are here

protected function ScheduledTransitionTestTrait::enabledBundles in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x tests/src/Traits/ScheduledTransitionTestTrait.php \Drupal\Tests\scheduled_transitions\Traits\ScheduledTransitionTestTrait::enabledBundles()

Enable bundles for use with scheduled transitions.

Parameters

array $bundles: Arrays of bundles. Where each bundle is an array containing:

  • 0: Entity type ID.
  • 1: Bundle ID.
11 calls to ScheduledTransitionTestTrait::enabledBundles()
ScheduledTransitionEntityTest::testAccessByBundle in tests/src/Functional/ScheduledTransitionEntityTest.php
Tests transition pages access depending on enabled entity type/bundle.
ScheduledTransitionEntityTransitionsFormTest::testTransitionsByPageLanguage in tests/src/Functional/ScheduledTransitionEntityTransitionsFormTest.php
Tests transitions appear on list according to page context language.
ScheduledTransitionLocalTaskTest::testLatestRevisionTab in tests/src/Functional/ScheduledTransitionLocalTaskTest.php
Tests latest revision tab.
ScheduledTransitionLocalTaskTest::testTabTitleByTranslation in tests/src/Functional/ScheduledTransitionLocalTaskTest.php
Tests local task tab title depending on viewed translation.
ScheduledTransitionModalFormTest::testLatestOptionPreselected in tests/src/Functional/ScheduledTransitionModalFormTest.php
Test by default the latest revision radio is prechecked.

... See full list

File

tests/src/Traits/ScheduledTransitionTestTrait.php, line 22

Class

ScheduledTransitionTestTrait
Test trait helpers.

Namespace

Drupal\Tests\scheduled_transitions\Traits

Code

protected function enabledBundles(array $bundles) : void {
  $enabledBundles = [];
  foreach ($bundles as $bundle) {
    $enabledBundles[] = [
      'entity_type' => $bundle[0],
      'bundle' => $bundle[1],
    ];
  }
  \Drupal::configFactory()
    ->getEditable('scheduled_transitions.settings')
    ->set('bundles', $enabledBundles)
    ->save(TRUE);
}