queue runner trait
1.1.0
Proporciona un rasgo para usar con la biblioteca Drupal Test Traits.
composer require --dev drupaltest/queue-runner-trait
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 ' );
}
}
Consulte la prueba incluida para ver un ejemplo detallado.