Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/drupaltest/queue-runner-trait
- Owner: drupaltest
- License: gpl-2.0
- Created: 2019-08-22T21:31:40.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-21T20:13:48.000Z (over 1 year ago)
- Last Synced: 2024-10-01T08:02:06.163Z (about 1 month ago)
- Topics: drupal-8, php, phpunit
- Language: PHP
- Size: 20.5 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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.