Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/drupaltest/queue-runner-trait

A queue runner trait for use with Drupal Test Traits.
https://github.com/drupaltest/queue-runner-trait

drupal-8 php phpunit

Last synced: 23 days ago
JSON representation

A queue runner trait for use with Drupal Test Traits.

Awesome Lists containing this project

README

        

# Queue Runner Trait

Provides a trait for use with the [Drupal Test Traits](https://gitlab.com/weitzman/drupal-test-traits) library.

[![Build Status](https://travis-ci.com/drupaltest/queue-runner-trait.svg?branch=master)](https://travis-ci.com/drupaltest/queue-runner-trait)

## Installation

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

## Usage

```php
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](./tests/QueueRunnerTraitTest.php) for a detailed example.