1414use Pheanstalk \Contract \JobIdInterface as PheanstalkJobIdInterface ;
1515
1616/**
17- *
1817 * Works with Queue servers.
1918 *
2019 * Testing with a selection of remote/local queueing services, including Amazon's SQS service
125124 * Queue:
126125 * 'type': 'aws',
127126 * 'region': 'us-west-2'
128- *
129127 */
130128class Queue extends Module
131129{
@@ -156,27 +154,27 @@ protected function validateConfig(): void
156154 protected function createQueueDriver (): \Codeception \Lib \Interfaces \Queue
157155 {
158156 switch ($ this ->config ['type ' ]) {
159- case 'aws ' :
160- case 'sqs ' :
161- case 'aws_sqs ' :
162- return new AmazonSQS ();
163- case 'iron ' :
164- case 'iron_mq ' :
165- return new Iron ();
166- case 'beanstalk ' :
167- case 'beanstalkd ' :
168- case 'beanstalkq ' :
169- // Account for different versions of Pheanstalk.
170- if (interface_exists (PheanstalkJobIdInterface::class)) {
171- return new Pheanstalk4 ();
172- } else {
173- return new Beanstalk ();
174- }
175- default :
176- throw new ModuleConfigException (
177- __CLASS__ ,
178- "Unknown queue type {$ this ->config ['type ' ]}; Supported queue types are: aws, iron, beanstalk "
179- );
157+ case 'aws ' :
158+ case 'sqs ' :
159+ case 'aws_sqs ' :
160+ return new AmazonSQS ();
161+ case 'iron ' :
162+ case 'iron_mq ' :
163+ return new Iron ();
164+ case 'beanstalk ' :
165+ case 'beanstalkd ' :
166+ case 'beanstalkq ' :
167+ // Account for different versions of Pheanstalk.
168+ if (interface_exists (PheanstalkJobIdInterface::class)) {
169+ return new Pheanstalk4 ();
170+ } else {
171+ return new Beanstalk ();
172+ }
173+ default :
174+ throw new ModuleConfigException (
175+ __CLASS__ ,
176+ "Unknown queue type {$ this ->config ['type ' ]}; Supported queue types are: aws, iron, beanstalk "
177+ );
180178 }
181179 }
182180
@@ -250,8 +248,8 @@ public function dontSeeEmptyQueue(string $queue): void
250248 * $I->seeQueueHasCurrentCount('default', 10);
251249 * ```
252250 *
253- * @param string $queue Queue name
254- * @param int $expected Number of messages expected
251+ * @param string $queue Queue name
252+ * @param int $expected Number of messages expected
255253 */
256254 public function seeQueueHasCurrentCount (string $ queue , int $ expected ): void
257255 {
@@ -266,8 +264,8 @@ public function seeQueueHasCurrentCount(string $queue, int $expected): void
266264 * $I->dontSeeQueueHasCurrentCount('default', 10);
267265 * ```
268266 *
269- * @param string $queue Queue name
270- * @param int $expected Number of messages expected
267+ * @param string $queue Queue name
268+ * @param int $expected Number of messages expected
271269 */
272270 public function dontSeeQueueHasCurrentCount (string $ queue , int $ expected ): void
273271 {
@@ -282,8 +280,8 @@ public function dontSeeQueueHasCurrentCount(string $queue, int $expected): void
282280 * $I->seeQueueHasTotalCount('default', 10);
283281 * ```
284282 *
285- * @param string $queue Queue name
286- * @param int $expected Number of messages expected
283+ * @param string $queue Queue name
284+ * @param int $expected Number of messages expected
287285 */
288286 public function seeQueueHasTotalCount (string $ queue , int $ expected ): void
289287 {
@@ -298,8 +296,8 @@ public function seeQueueHasTotalCount(string $queue, int $expected): void
298296 * $I->dontSeeQueueHasTotalCount('default', 10);
299297 * ```
300298 *
301- * @param string $queue Queue name
302- * @param int $expected Number of messages expected
299+ * @param string $queue Queue name
300+ * @param int $expected Number of messages expected
303301 */
304302 public function dontSeeQueueHasTotalCount (string $ queue , int $ expected ): void
305303 {
@@ -317,7 +315,7 @@ public function dontSeeQueueHasTotalCount(string $queue, int $expected): void
317315 * ```
318316 *
319317 * @param string $message Message Body
320- * @param string $queue Queue name
318+ * @param string $queue Queue name
321319 */
322320 public function addMessageToQueue (string $ message , string $ queue ): void
323321 {
@@ -364,7 +362,7 @@ public function grabQueues(): array
364362 * $I->grabQueueCurrentCount('default');
365363 * ```
366364 *
367- * @param string $queue Queue name
365+ * @param string $queue Queue name
368366 * @return int Count
369367 */
370368 public function grabQueueCurrentCount (string $ queue )
@@ -380,7 +378,7 @@ public function grabQueueCurrentCount(string $queue)
380378 * $I->grabQueueTotalCount('default');
381379 * ```
382380 *
383- * @param string $queue Queue name
381+ * @param string $queue Queue name
384382 * @return int Count
385383 */
386384 public function grabQueueTotalCount (string $ queue )
0 commit comments