2017-11-27 04:59:15 +05:30
|
|
|
<?php
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace common\tests\_support\queue;
|
2017-11-27 04:59:15 +05:30
|
|
|
|
|
|
|
use yii\base\NotSupportedException;
|
|
|
|
use yii\queue\Queue as BaseQueue;
|
|
|
|
|
|
|
|
class Queue extends BaseQueue {
|
|
|
|
|
|
|
|
private $messages = [];
|
|
|
|
|
2018-04-18 02:17:25 +05:30
|
|
|
public function __set($name, $value) {
|
|
|
|
// Yii2 components may contains some configuration
|
|
|
|
// But we just ignore it for this mock component
|
|
|
|
}
|
|
|
|
|
2017-11-27 04:59:15 +05:30
|
|
|
public function push($job) {
|
|
|
|
$this->messages[] = $job;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function status($id) {
|
|
|
|
throw new NotSupportedException('Status is not supported in the driver.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMessages() {
|
|
|
|
return $this->messages;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected function pushMessage($message, $ttr, $delay, $priority) {
|
|
|
|
// This function is abstract, but will be not called
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|