protected function ScheduledTransitionTestTrait::enabledBundles in Scheduled Transitions 2.x
Same name and namespace in other branches
- 8 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.
13 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.
- ScheduledTransitionModalFormJavascriptTest::testRevisionLogOverride in tests/
src/ FunctionalJavascript/ ScheduledTransitionModalFormJavascriptTest.php - Tests revision logs.
File
- tests/
src/ Traits/ ScheduledTransitionTestTrait.php, line 22
Class
- ScheduledTransitionTestTrait
- Test trait helpers.
Namespace
Drupal\Tests\scheduled_transitions\TraitsCode
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);
}