1818use Flowpack \JobQueue \Common \Tests \Unit \Fixtures \TestJob ;
1919use Flowpack \JobQueue \Common \Tests \Unit \Fixtures \TestQueue ;
2020use Neos \Flow \Tests \FunctionalTestCase ;
21+ use PHPUnit \Framework \Constraint \Constraint ;
22+ use PHPUnit \Framework \Constraint \IsInstanceOf ;
23+ use PHPUnit \Framework \MockObject \MockObject ;
2124
2225/**
2326 * Functional tests for the JobManager
@@ -32,7 +35,7 @@ class JobManagerTest extends FunctionalTestCase
3235
3336
3437 /**
35- * @var QueueManager|\PHPUnit_Framework_MockObject_MockObject
38+ * @var QueueManager|MockObject
3639 */
3740 protected $ mockQueueManager ;
3841
@@ -104,7 +107,7 @@ protected function assertSignalEmitted($signalName, array $arguments = [])
104107 $ this ->assertCount (1 , $ this ->emittedSignals [$ fullSignalName ]);
105108 foreach ($ arguments as $ argumentIndex => $ expectedArgument ) {
106109 $ actualArgument = $ this ->emittedSignals [$ fullSignalName ][0 ][$ argumentIndex ];
107- if ($ expectedArgument instanceof \PHPUnit_Framework_Constraint ) {
110+ if ($ expectedArgument instanceof Constraint ) {
108111 $ expectedArgument ->evaluate ($ actualArgument );
109112 } else {
110113 $ this ->assertSame ($ expectedArgument , $ actualArgument );
@@ -139,7 +142,7 @@ public function waitAndExecuteEmitsMessageReservedSignal()
139142 {
140143 $ this ->jobManager ->queue ('TestQueue ' , new TestJob ());
141144 $ this ->jobManager ->waitAndExecute ('TestQueue ' );
142- $ this ->assertSignalEmitted ('messageReserved ' , [0 => $ this ->testQueue , 1 => new \ PHPUnit_Framework_Constraint_IsInstanceOf (Message::class)]);
145+ $ this ->assertSignalEmitted ('messageReserved ' , [0 => $ this ->testQueue , 1 => new IsInstanceOf (Message::class)]);
143146 }
144147
145148 /**
@@ -149,7 +152,7 @@ public function waitAndExecuteEmitsMessageFinishedSignal()
149152 {
150153 $ this ->jobManager ->queue ('TestQueue ' , new TestJob ());
151154 $ this ->jobManager ->waitAndExecute ('TestQueue ' );
152- $ this ->assertSignalEmitted ('messageFinished ' , [0 => $ this ->testQueue , 1 => new \ PHPUnit_Framework_Constraint_IsInstanceOf (Message::class)]);
155+ $ this ->assertSignalEmitted ('messageFinished ' , [0 => $ this ->testQueue , 1 => new IsInstanceOf (Message::class)]);
153156 }
154157
155158 /**
@@ -164,7 +167,7 @@ public function waitAndExecuteEmitsMessageReleasedSignal()
164167 $ this ->jobManager ->waitAndExecute ('TestQueue ' );
165168 } catch (JobQueueException $ exception ) {
166169 }
167- $ this ->assertSignalEmitted ('messageReleased ' , [$ this ->testQueue , new \ PHPUnit_Framework_Constraint_IsInstanceOf (Message::class), $ releaseOptions , new \ PHPUnit_Framework_Constraint_IsInstanceOf (JobQueueException::class)]);
170+ $ this ->assertSignalEmitted ('messageReleased ' , [$ this ->testQueue , new IsInstanceOf (Message::class), $ releaseOptions , new IsInstanceOf (JobQueueException::class)]);
168171 }
169172
170173 /**
@@ -177,6 +180,6 @@ public function waitAndExecuteEmitsMessageFailedSignal()
177180 $ this ->jobManager ->waitAndExecute ('TestQueue ' );
178181 } catch (JobQueueException $ exception ) {
179182 }
180- $ this ->assertSignalEmitted ('messageFailed ' , [$ this ->testQueue , new \ PHPUnit_Framework_Constraint_IsInstanceOf (Message::class)]);
183+ $ this ->assertSignalEmitted ('messageFailed ' , [$ this ->testQueue , new IsInstanceOf (Message::class)]);
181184 }
182- }
185+ }
0 commit comments