queue runner trait
1.1.0
提供與 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 ' );
}
}
有關詳細範例,請參閱包含的測試。