2017-11-27 02:29:15 +03:00
|
|
|
<?php
|
2019-02-20 22:58:52 +03:00
|
|
|
namespace common\tests\_support\queue;
|
2017-11-27 02:29:15 +03:00
|
|
|
|
|
|
|
use yii\base\NotSupportedException;
|
|
|
|
use yii\queue\Queue as BaseQueue;
|
|
|
|
|
|
|
|
class Queue extends BaseQueue {
|
|
|
|
|
2024-12-02 15:10:55 +05:00
|
|
|
private array $messages = [];
|
2017-11-27 02:29:15 +03:00
|
|
|
|
2018-04-17 23:47:25 +03:00
|
|
|
public function __set($name, $value) {
|
|
|
|
// Yii2 components may contains some configuration
|
|
|
|
// But we just ignore it for this mock component
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:10:55 +05:00
|
|
|
public function push($job): ?string {
|
|
|
|
return (string)array_push($this->messages, $job);
|
2017-11-27 02:29:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
public function status($id) {
|
|
|
|
throw new NotSupportedException('Status is not supported in the driver.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMessages() {
|
|
|
|
return $this->messages;
|
|
|
|
}
|
|
|
|
|
2024-12-02 15:10:55 +05:00
|
|
|
protected function pushMessage($message, $ttr, $delay, $priority): string {
|
|
|
|
return '';
|
2017-11-27 02:29:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|