66use Enqueue \Consumption \Result ;
77use Enqueue \Null \NullMessage ;
88use Enqueue \Util \JSON ;
9- use Interop \Queue \PsrContext ;
10- use Interop \Queue \PsrProcessor ;
9+ use Interop \Queue \Context ;
10+ use Interop \Queue \Processor ;
1111use PHPUnit \Framework \TestCase ;
1212use Quartz \Bridge \Scheduler \JobRunShellProcessor ;
1313use Quartz \Scheduler \StdJobRunShell ;
1616
1717class JobRunShellProcessorTest extends TestCase
1818{
19- public function testShouldImplementPsrProcessorInterface ()
19+ public function testShouldImplementProcessorInterface ()
2020 {
2121 $ processor = new JobRunShellProcessor ($ this ->createJobStore (), $ this ->createJobRunShell ());
2222
23- $ this ->assertInstanceOf (PsrProcessor ::class, $ processor );
23+ $ this ->assertInstanceOf (Processor ::class, $ processor );
2424 }
2525
2626 public function testShouldImplementCommandSubscriberInterfaceAndReturnExpectectedSubscribedCommand ()
@@ -30,9 +30,9 @@ public function testShouldImplementCommandSubscriberInterfaceAndReturnExpectecte
3030 $ this ->assertInstanceOf (CommandSubscriberInterface::class, $ processor );
3131
3232 $ expectedConfig = [
33- 'processorName ' => 'quartz_job_run_shell ' ,
34- 'queueName ' => 'quartz_job_run_shell ' ,
35- 'queueNameHardcoded ' => true ,
33+ 'command ' => 'quartz_job_run_shell ' ,
34+ 'queue ' => 'quartz_job_run_shell ' ,
35+ 'prefix_queue ' => false ,
3636 'exclusive ' => true ,
3737 ];
3838
@@ -64,7 +64,7 @@ public function testShouldRejectMessageIfJobInstanceIdIsNotSet()
6464
6565 $ processor = new JobRunShellProcessor ($ store , $ shell );
6666
67- $ result = $ processor ->process (new NullMessage (), $ this ->createMock (PsrContext ::class));
67+ $ result = $ processor ->process (new NullMessage (), $ this ->createMock (Context ::class));
6868
6969 $ this ->assertInstanceOf (Result::class, $ result );
7070 $ this ->assertSame ('fire instance id is empty ' , $ result ->getReason ());
@@ -91,7 +91,7 @@ public function testShouldRejectMessageIfJobInstanceWasNotFound()
9191 'fireInstanceId ' => '1234 ' ,
9292 ]));
9393
94- $ result = $ processor ->process ($ message , $ this ->createMock (PsrContext ::class));
94+ $ result = $ processor ->process ($ message , $ this ->createMock (Context ::class));
9595
9696 $ this ->assertInstanceOf (Result::class, $ result );
9797 $ this ->assertSame ('There is not trigger with fire instance id: "1234" ' , $ result ->getReason ());
@@ -122,9 +122,10 @@ public function testShouldPassTriggerToJobRunShell()
122122 'fireInstanceId ' => '1234 ' ,
123123 ]));
124124
125- $ result = $ processor ->process ($ message , $ this ->createMock (PsrContext ::class));
125+ $ result = $ processor ->process ($ message , $ this ->createMock (Context ::class));
126126
127- $ this ->assertSame (Result::ACK , $ result );
127+ $ this ->assertInstanceOf (Result::class, $ result );
128+ $ this ->assertSame (Result::ACK , $ result ->getStatus ());
128129 }
129130
130131 /**
0 commit comments