drupaltest/queue-runner-trait

A Drupal queue runner trait for use with Drupal Test Traits.

Installs: 29 145

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 4

Forks: 1

Open Issues: 0

Type:drupal-dtt

v1.2.0 2023-04-21 20:12 UTC

This package is auto-updated.

Last update: 2024-10-21 23:11:59 UTC


README

Provides a trait for use with the Drupal Test Traits library.

Build Status

Installation

composer require --dev drupaltest/queue-runner-trait

Usage

class SampleTestWithQueueRunner extends ExistingSiteBase
{
    use QueueRunnerTrait;

    protected function tearDown()
    {
        // Empty a given queue after the test has finished.
        $this->clearQueue('my_queue_name');
    }

    public function testSomeQueue()
    {
        // Do something that adds an item to a queue.
        
        // Run the queue by name.
        $this->runQueue('my_queue_name');
    }
}

See the included test for a detailed example.