function CronQueueTestDeriver::getDerivativeDefinitions

Same name in other branches
  1. 11.x core/modules/system/tests/modules/cron_queue_test/src/Plugin/Derivative/CronQueueTestDeriver.php \Drupal\cron_queue_test\Plugin\Derivative\CronQueueTestDeriver::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

File

core/modules/system/tests/modules/cron_queue_test/src/Plugin/Derivative/CronQueueTestDeriver.php, line 15

Class

CronQueueTestDeriver
Provides a deriver for testing cron queues.

Namespace

Drupal\cron_queue_test\Plugin\Derivative

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    $example_data = [
        'foo' => 'Foo',
        'bar' => 'Bar',
    ];
    $derivatives = [];
    foreach ($example_data as $key => $label) {
        $derivatives[$key] = [
            'title' => strtr('Cron queue test: @label', [
                '@label' => $label,
            ]),
        ] + $base_plugin_definition;
    }
    return $derivatives;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.