Skip to content

Commit

Permalink
Merge pull request #39 from markhuot/run-queue
Browse files Browse the repository at this point in the history
Auto-run queue
  • Loading branch information
markhuot authored Oct 23, 2024
2 parents 6c98272 + 501e839 commit 4db8d10
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@ protected function tearDown(): void
$this->callTraits('tearDown');
}

/**
* Run the queue after every test case if it's setup as a sync queue
*/
protected function assertPostConditions(): void
{
$queue = Craft::$app->queue;

if ($queue instanceof \yii\queue\sync\Queue) {
$queue->run();
}

parent::assertPostConditions();
}

protected function callTraits($prefix)
{
$traits = [];
Expand Down

0 comments on commit 4db8d10

Please sign in to comment.