drupaltest/queue-runner-trait

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

v1.0.0 2019-08-22 22:26 UTC

This package is auto-updated.

Last update: 2020-07-29 20:10:11 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.