@@ -56,7 +56,6 @@ class PublisherConsumerController
56
56
private $ clearQueueProcessor ;
57
57
58
58
/**
59
- * PublisherConsumerController constructor.
60
59
* @param PublisherInterface $publisher
61
60
* @param OsInfo $osInfo
62
61
* @param Amqp $amqpHelper
@@ -70,18 +69,18 @@ public function __construct(
70
69
PublisherInterface $ publisher ,
71
70
OsInfo $ osInfo ,
72
71
Amqp $ amqpHelper ,
73
- $ logFilePath ,
74
- $ consumers ,
75
- $ appInitParams ,
76
- $ maxMessages = null ,
72
+ string $ logFilePath = TESTS_TEMP_DIR . ' /MessageQueueTestLog.txt ' ,
73
+ array $ consumers = [] ,
74
+ array $ appInitParams = [] ,
75
+ ? int $ maxMessages = null ,
77
76
ClearQueueProcessor $ clearQueueProcessor = null
78
77
) {
79
78
$ this ->consumers = $ consumers ;
80
79
$ this ->publisher = $ publisher ;
81
80
$ this ->logFilePath = $ logFilePath ;
82
81
$ this ->maxMessages = $ maxMessages ;
83
82
$ this ->osInfo = $ osInfo ;
84
- $ this ->appInitParams = $ appInitParams ;
83
+ $ this ->appInitParams = $ appInitParams ?: Bootstrap:: getInstance ()-> getAppInitParams () ;
85
84
$ this ->amqpHelper = $ amqpHelper ;
86
85
$ this ->clearQueueProcessor = $ clearQueueProcessor
87
86
?: Bootstrap::getObjectManager ()->get (ClearQueueProcessor::class);
@@ -200,13 +199,13 @@ private function getConsumerStartCommand($consumer, $withEnvVariables = false)
200
199
* @param array $params
201
200
* @throws PreconditionFailedException
202
201
*/
203
- public function waitForAsynchronousResult (callable $ condition , $ params )
202
+ public function waitForAsynchronousResult (callable $ condition , $ params = [] )
204
203
{
205
204
$ i = 0 ;
206
205
do {
207
206
sleep (3 );
208
207
$ assertion = call_user_func_array ($ condition , $ params );
209
- } while (!$ assertion && ($ i ++ < 10 ));
208
+ } while (!$ assertion && ($ i ++ < 20 ));
210
209
211
210
if (!$ assertion ) {
212
211
throw new PreconditionFailedException ("No asynchronous messages were processed. " );
0 commit comments