File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1313use  Illuminate \Support \Str ;
1414use  Illuminate \Validation \ValidationException ;
1515use  Safe \Exceptions \JsonException ;
16- use  stdClass ;
1716use  UnexpectedValueException ;
1817use  function  Safe \json_decode ;
1918
@@ -98,11 +97,8 @@ private function captureTask($task): array
9897
9998    private  function  loadQueueConnectionConfiguration (array  $ taskvoid 
10099    {
101-         /** 
102-          * @var stdClass $command 
103-          */ 
104100        $ commandself ::getCommandProperties ($ task'data ' ]['command ' ]);
105-         $ connection$ command-> connection  ?? config ('queue.default ' );
101+         $ connection$ command[ ' connection ' ]  ?? config ('queue.default ' );
106102        $ baseConfigconfig ('queue.connections. '  . $ connection
107103        $ confignew  CloudTasksConnector ())->connect ($ baseConfigconfig ;
108104
Original file line number Diff line number Diff line change @@ -222,6 +222,26 @@ public function it_can_run_a_task()
222222        Log::assertLogged ('SimpleJob:success ' );
223223    }
224224
225+     /** 
226+      * @test 
227+      */ 
228+     public  function  it_can_run_a_task_using_the_task_connection ()
229+     {
230+         // Arrange 
231+         OpenIdVerificator::fake ();
232+         Log::swap (new  LogFake ());
233+         Event::fake ([JobProcessing::class, JobProcessed::class]);
234+         $ this app ['config ' ]->set ('queue.default ' , 'non-existing-connection ' );
235+ 
236+         // Act 
237+         $ jobnew  SimpleJob ();
238+         $ jobconnection  = 'my-cloudtasks-connection ' ;
239+         $ this dispatch ($ jobrunWithoutExceptionHandler ();
240+ 
241+         // Assert 
242+         Log::assertLogged ('SimpleJob:success ' );
243+     }
244+ 
225245    /** 
226246     * @test 
227247     */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments