function LauncherPluginTest::testDiscovery in Ultimate Cron 8.2
Tests that scheduler plugins are discovered correctly.
File
- tests/
src/ Kernel/ LauncherPluginTest.php, line 25
Class
- LauncherPluginTest
- Tests the default scheduler plugins.
Namespace
Drupal\Tests\ultimate_cron\KernelCode
function testDiscovery() {
/* @var \Drupal\Core\Plugin\DefaultPluginManager $manager */
$manager = \Drupal::service('plugin.manager.ultimate_cron.launcher');
$plugins = $manager
->getDefinitions();
$this
->assertCount(1, $plugins);
$serial = $manager
->createInstance('serial');
$this
->assertTrue($serial instanceof SerialLauncher);
$this
->assertEquals('serial', $serial
->getPluginId());
}