Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 391c5f7

Browse files
committed
wip coverage & namings
1 parent d0b4f46 commit 391c5f7

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

tests/AsyncRedisQueueTest.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace BeyondCode\LaravelWebSockets\Test;
44

5-
use BeyondCode\LaravelWebSockets\Queue\AsyncRedisQueue;
5+
use BeyondCode\LaravelWebSockets\Queue\AsyncRedisConnector;
66
use Illuminate\Queue\Queue;
77
use Illuminate\Support\InteractsWithTime;
88
use Mockery as m;
@@ -27,9 +27,13 @@ public function setUp(): void
2727

2828
$this->runOnlyOnRedisReplication();
2929

30-
$this->queue = new AsyncRedisQueue(
31-
$this->app['redis'], 'default', null, 60, null
32-
);
30+
$connector = new AsyncRedisConnector($this->app['redis'], 'default');
31+
32+
$this->queue = $connector->connect([
33+
'queue' => 'default',
34+
'retry_after' => 60,
35+
'block_for' => null,
36+
]);
3337

3438
$this->queue->setContainer($this->app);
3539
}
@@ -44,7 +48,7 @@ protected function tearDown(): void
4448
m::close();
4549
}
4650

47-
public function test_expired_jobs_are_popped()
51+
public function test_expired_jobs_are_pushed_with_async_and_popped_with_sync()
4852
{
4953
$jobs = [
5054
new RedisQueueIntegrationTestJob(0),
@@ -75,7 +79,7 @@ public function test_expired_jobs_are_popped()
7579
$this->assertEquals(3, $this->app['redis']->connection()->zcard('queues:default:reserved'));
7680
}
7781

78-
public function test_release_job()
82+
public function test_jobs_are_pushed_with_async_and_released_with_sync()
7983
{
8084
$this->queue->push(
8185
$job = new RedisQueueIntegrationTestJob(30)
@@ -114,7 +118,7 @@ public function test_release_job()
114118
$this->assertNull($this->queue->pop());
115119
}
116120

117-
public function test_delete_job()
121+
public function test_jobs_are_pushed_with_async_and_deleted_with_sync()
118122
{
119123
$this->queue->push(
120124
$job = new RedisQueueIntegrationTestJob(30)
@@ -136,7 +140,7 @@ public function test_delete_job()
136140
$this->assertNull($this->queue->pop());
137141
}
138142

139-
public function test_clear_job()
143+
public function test_jobs_are_pushed_with_async_and_cleared_with_sync()
140144
{
141145
if (! method_exists($this->queue, 'clear')) {
142146
$this->markTestSkipped('The Queue has no clear() method to test.');
@@ -157,7 +161,7 @@ public function test_clear_job()
157161
$this->assertEquals(0, $this->queue->size());
158162
}
159163

160-
public function test_size_job()
164+
public function test_jobs_are_pushed_with_async_and_size_reflects_in_async_size()
161165
{
162166
$this->queue->size()->then(function ($count) {
163167
$this->assertEquals(0, $count);

0 commit comments

Comments
 (0)