-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathQueueTest.php
More file actions
60 lines (48 loc) · 1.46 KB
/
QueueTest.php
File metadata and controls
60 lines (48 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
declare(strict_types=1);
/**
* This file is part of CodeIgniter Queue.
*
* (c) CodeIgniter Foundation <admin@codeigniter.com>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Tests;
use CodeIgniter\Queue\Exceptions\QueueException;
use CodeIgniter\Queue\Handlers\DatabaseHandler;
use CodeIgniter\Queue\Queue;
use Tests\Support\Config\Queue as QueueConfig;
use Tests\Support\Database\Seeds\TestDatabaseQueueSeeder;
use Tests\Support\TestCase;
/**
* @internal
*/
final class QueueTest extends TestCase
{
protected $seed = TestDatabaseQueueSeeder::class;
private QueueConfig $config;
protected function setUp(): void
{
parent::setUp();
$this->config = config(QueueConfig::class);
}
public function testQueue(): void
{
$queue = new Queue($this->config);
$this->assertInstanceOf(Queue::class, $queue);
}
public function testQueueException(): void
{
$this->expectException(QueueException::class);
$this->expectExceptionMessage('This queue handler is incorrect.');
$this->config->defaultHandler = 'not-exists';
$queue = new Queue($this->config);
$this->assertInstanceOf(Queue::class, $queue);
}
public function testQueueInit(): void
{
$queue = new Queue($this->config);
$this->assertInstanceOf(DatabaseHandler::class, $queue->init());
}
}