2
2
3
3
namespace LaravelQless \Tests \Queue ;
4
4
5
+ use Illuminate \Contracts \Queue \Queue as QueueContract ;
6
+ use Illuminate \Queue \Queue ;
5
7
use Illuminate \Queue \QueueManager ;
8
+ use Illuminate \Support \Str ;
6
9
use LaravelQless \Contracts \JobHandler ;
7
10
use LaravelQless \Handler \DefaultHandler ;
8
11
use LaravelQless \Job \QlessJob ;
9
12
use LaravelQless \Queue \QlessConnector ;
10
13
use LaravelQless \Queue \QlessQueue ;
11
14
use Orchestra \Testbench \TestCase ;
12
- use Illuminate \Contracts \Queue \Queue as QueueContract ;
13
- use Illuminate \Queue \Queue ;
14
15
use Qless \Client ;
15
16
16
17
class QueueTest extends TestCase
@@ -40,7 +41,7 @@ public function testPushPop()
40
41
{
41
42
$ queue = $ this ->getQueue ();
42
43
43
- $ queueName = str_random (16 );
44
+ $ queueName = Str:: random (16 );
44
45
45
46
$ jobId = $ queue ->push (Job::class, ['firstKey ' => 'firstValue ' ], $ queueName );
46
47
@@ -66,7 +67,7 @@ public function testSubscribe()
66
67
{
67
68
$ queue = $ this ->getQueue ();
68
69
69
- $ queuePrefix = str_random (4 ) . '_ ' ;
70
+ $ queuePrefix = Str:: random (4 ) . '_ ' ;
70
71
71
72
for ($ i = 1 ; $ i <=3 ; $ i ++) {
72
73
$ queue ->push (Job::class, ['firstKey ' => 'firstValue ' ], $ queuePrefix . $ i );
@@ -102,7 +103,7 @@ public function testUnSubscribe()
102
103
{
103
104
$ queue = $ this ->getQueue ();
104
105
105
- $ queuePrefix = str_random (4 ) . '_ ' ;
106
+ $ queuePrefix = Str:: random (4 ) . '_ ' ;
106
107
107
108
for ($ i = 1 ; $ i <=2 ; $ i ++) {
108
109
$ queue ->push (Job::class, ['firstKey ' => 'firstValue ' ], $ queuePrefix . $ i );
@@ -130,7 +131,7 @@ public function testUnSubscribe()
130
131
*/
131
132
public function testSize ()
132
133
{
133
- $ queueName = str_random ();
134
+ $ queueName = Str:: random ();
134
135
135
136
$ queue = $ this ->getQueue ();
136
137
@@ -152,9 +153,9 @@ public function testSize()
152
153
*/
153
154
public function testJobOptions ()
154
155
{
155
- $ queueName = str_random ();
156
+ $ queueName = Str:: random ();
156
157
157
- $ jid = str_random (16 );
158
+ $ jid = Str:: random (16 );
158
159
159
160
$ queue = $ this ->getQueue ();
160
161
@@ -179,7 +180,7 @@ public function testDispatchJob()
179
180
{
180
181
$ this ->setEnv ();
181
182
182
- $ queueName = str_random ();
183
+ $ queueName = Str:: random ();
183
184
184
185
$ job = new Job (['dispatch ' => 'work ' ]);
185
186
@@ -203,7 +204,7 @@ public function testDispatchNowJob()
203
204
{
204
205
$ this ->setEnv ();
205
206
206
- $ queueName = str_random ();
207
+ $ queueName = Str:: random ();
207
208
208
209
$ dispatch = Job::dispatchNow (['dispatchNow ' => 'work_as_sync ' ])
209
210
->onQueue ($ queueName )
0 commit comments