first commit

This commit is contained in:
675061370@qq.com
2024-04-04 21:28:09 +08:00
commit fe9661855e
4192 changed files with 618218 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
<?php
namespace think\test\queue;
use Mockery as m;
use PHPUnit\Framework\TestCase;
use think\App;
use think\Config;
use think\Queue;
use think\queue\connector\Sync;
class QueueTest extends TestCase
{
public function tearDown()
{
m::close();
}
public function testDefaultConnectionCanBeResolved()
{
$app = m::mock(App::class);
$sync = new Sync();
$app->shouldReceive('make')->once()->with('\think\queue\connector\Sync')->andReturn($sync);
$config = m::mock(Config::class);
$config->shouldReceive('get')->once()->with('queue.connector', 'Sync')->andReturn('sync');
$app->shouldReceive('get')->once()->with('config')->andReturn($config);
$queue = new Queue($app);
$this->assertSame($sync, $queue->driver('sync'));
$this->assertSame($sync, $queue->driver());
}
}