mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Add basic unit tests for Queue class using Dummy driver
This commit is contained in:
parent
b4e7d4aaad
commit
4b0b485a13
2 changed files with 36 additions and 1 deletions
23
tests/unit/framework/QueueTest.php
Normal file
23
tests/unit/framework/QueueTest.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
class QueueTest extends \Codeception\Test\Unit
|
||||
{
|
||||
public function testDummyQueue()
|
||||
{
|
||||
config('queue.driver', 'dummy');
|
||||
|
||||
$handler = 'myfunc';
|
||||
$args = (object)['foo' => 'bar'];
|
||||
$options = (object)['key' => 'val'];
|
||||
|
||||
Rhymix\Framework\Queue::addTask($handler, $args, $options);
|
||||
|
||||
$output = Rhymix\Framework\Queue::getTask();
|
||||
$this->assertEquals('myfunc', $output->handler);
|
||||
$this->assertEquals('bar', $output->args->foo);
|
||||
$this->assertEquals('val', $output->options->key);
|
||||
|
||||
$output = Rhymix\Framework\Queue::getTask();
|
||||
$this->assertNull($output);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue