public function ScheduledTransitionsUtilityTest::testGetApplicableBundles in Scheduled Transitions 8
Same name and namespace in other branches
- 2.x 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);
}