CronQueueTestDeriver.php

Same filename and directory in other branches
  1. 10 core/modules/system/tests/modules/cron_queue_test/src/Plugin/Derivative/CronQueueTestDeriver.php

Namespace

Drupal\cron_queue_test\Plugin\Derivative

File

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

View source
<?php

namespace Drupal\cron_queue_test\Plugin\Derivative;

use Drupal\Component\Plugin\Derivative\DeriverBase;

/**
 * Provides a deriver for testing cron queues.
 */
class CronQueueTestDeriver extends DeriverBase {
    
    /**
     * {@inheritdoc}
     */
    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;
    }

}

Classes

Title Deprecated Summary
CronQueueTestDeriver Provides a deriver for testing cron queues.

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