3
3
namespace TimoKoerber \LaravelOneTimeOperations \Tests \Feature ;
4
4
5
5
use Illuminate \Foundation \Testing \RefreshDatabase ;
6
+ use Illuminate \Support \Facades \Config ;
6
7
use Illuminate \Support \Facades \File ;
7
8
use Illuminate \Support \Facades \Queue ;
8
9
use Illuminate \Support \Str ;
@@ -113,7 +114,7 @@ public function test_the_whole_command_process()
113
114
// operation was exectued - database entry and job was created
114
115
$ this ->assertEquals (1 , Operation::count ());
115
116
Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
116
- return $ job ->connection === null ; // async
117
+ return $ job ->connection === Config:: get ( ' one-time-operations.queue_connection ' ) ; // async
117
118
});
118
119
119
120
// entry was created successfully
@@ -221,7 +222,7 @@ public function test_sync_processing_with_file_attribute()
221
222
// Job was executed asynchronously
222
223
Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
223
224
return $ job ->operationName === '2015_10_21_072800_foo_bar_operation '
224
- && $ job ->connection === null // async
225
+ && $ job ->connection === Config:: get ( ' one-time-operations.queue_connection ' ) // async
225
226
&& $ job ->queue === 'default ' ; // default queue
226
227
});
227
228
@@ -237,7 +238,7 @@ public function test_sync_processing_with_file_attribute()
237
238
// Job was executed asynchronously on queue "foobar"
238
239
Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
239
240
return $ job ->operationName === '2015_10_21_072800_foo_bar_operation '
240
- && $ job ->connection === null // async
241
+ && $ job ->connection === Config:: get ( ' one-time-operations.queue_connection ' ) // async
241
242
&& $ job ->queue === 'foobar ' ; // default queue
242
243
});
243
244
}
@@ -258,7 +259,7 @@ public function test_processing_with_queue()
258
259
// Job was executed synchronously
259
260
Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
260
261
return $ job ->operationName === '2015_10_21_072800_foo_bar_operation '
261
- && $ job ->connection === null // async
262
+ && $ job ->connection === Config:: get ( ' one-time-operations.queue_connection ' ) // async
262
263
&& $ job ->queue === 'narfpuit ' ; // queue narfpuit
263
264
});
264
265
@@ -270,7 +271,7 @@ public function test_processing_with_queue()
270
271
// Job was executed asynchronously on queue "foobar"
271
272
Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
272
273
return $ job ->operationName === '2015_10_21_072800_foo_bar_operation '
273
- && $ job ->connection === null // async
274
+ && $ job ->connection === Config:: get ( ' one-time-operations.queue_connection ' ) // async
274
275
&& $ job ->queue === 'foobar ' ; // queue foobar
275
276
});
276
277
}
0 commit comments