public function ScheduledTransitionsUtilityTest::testGetApplicableBundles in Scheduled Transitions 2.x
Same name and namespace in other branches
- 8 tests/src/Kernel/ScheduledTransitionsUtilityTest.php \Drupal\Tests\scheduled_transitions\Kernel\ScheduledTransitionsUtilityTest::testGetApplicableBundles()
Tests applicable bundles helper.
@covers ::getApplicableBundles
File
- tests/
src/ Kernel/ ScheduledTransitionsUtilityTest.php, line 51
Class
- ScheduledTransitionsUtilityTest
- Tests scheduled transactions utility.
Namespace
Drupal\Tests\scheduled_transitions\KernelCode
public function testGetApplicableBundles() : void {
/** @var \Drupal\scheduled_transitions\ScheduledTransitionsUtilityInterface $scheduledTransitionsUtility */
$scheduledTransitionsUtility = \Drupal::service('scheduled_transitions.utility');
$result = $scheduledTransitionsUtility
->getApplicableBundles();
$this
->assertEquals([], $result);
$workflow = $this
->createEditorialWorkflow();
$workflow
->getTypePlugin()
->addEntityTypeAndBundle('entity_test_revlog', 'entity_test_revlog');
$workflow
->save();
$result = $scheduledTransitionsUtility
->getApplicableBundles();
$this
->assertEquals([
'entity_test_revlog' => [
'entity_test_revlog',
],
], $result);
}