33namespace TimoKoerber \LaravelOneTimeOperations \Tests \Feature ;
44
55use Illuminate \Foundation \Testing \RefreshDatabase ;
6+ use Illuminate \Support \Facades \Config ;
67use Illuminate \Support \Facades \File ;
78use Illuminate \Support \Facades \Queue ;
89use Illuminate \Support \Str ;
@@ -113,7 +114,7 @@ public function test_the_whole_command_process()
113114 // operation was exectued - database entry and job was created
114115 $ this ->assertEquals (1 , Operation::count ());
115116 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
117118 });
118119
119120 // entry was created successfully
@@ -221,7 +222,7 @@ public function test_sync_processing_with_file_attribute()
221222 // Job was executed asynchronously
222223 Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
223224 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
225226 && $ job ->queue === 'default ' ; // default queue
226227 });
227228
@@ -237,7 +238,7 @@ public function test_sync_processing_with_file_attribute()
237238 // Job was executed asynchronously on queue "foobar"
238239 Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
239240 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
241242 && $ job ->queue === 'foobar ' ; // default queue
242243 });
243244 }
@@ -258,7 +259,7 @@ public function test_processing_with_queue()
258259 // Job was executed synchronously
259260 Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
260261 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
262263 && $ job ->queue === 'narfpuit ' ; // queue narfpuit
263264 });
264265
@@ -270,7 +271,7 @@ public function test_processing_with_queue()
270271 // Job was executed asynchronously on queue "foobar"
271272 Queue::assertPushed (OneTimeOperationProcessJob::class, function (OneTimeOperationProcessJob $ job ) {
272273 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
274275 && $ job ->queue === 'foobar ' ; // queue foobar
275276 });
276277 }
0 commit comments