Компонент RabbitMQ для тестов заменён на заглушку

This commit is contained in:
ErickSkrauch
2016-12-04 15:49:45 +03:00
parent 9274155cfc
commit 363b25e6da
4 changed files with 36 additions and 22 deletions

View File

@@ -5,7 +5,6 @@ modules:
- Yii2
- tests\codeception\common\_support\FixtureHelper
- Redis
- AMQP
- Asserts
- REST:
depends: Yii2
@@ -17,10 +16,3 @@ modules:
host: testredis
port: 6379
database: 0
AMQP:
host: testrabbit
port: 5672
username: 'ely-accounts-tester'
password: 'tester-password'
vhost: '/account.ely.by/tests'
queues: []

View File

@@ -0,0 +1,33 @@
<?php
namespace tests\codeception\common\_support;
use common\components\RabbitMQ\Component;
use PhpAmqpLib\Connection\AbstractConnection;
class RabbitMQComponent extends Component {
public function getConnection() {
/** @noinspection MagicMethodsValidityInspection */
/** @noinspection PhpMissingParentConstructorInspection */
return new class extends AbstractConnection {
public function __construct(
$user,
$password,
$vhost,
$insist,
$login_method,
$login_response,
$locale,
\PhpAmqpLib\Wire\IO\AbstractIO $io,
$heartbeat
) {
// ничего не делаем
}
};
}
public function sendToExchange($exchangeName, $routingKey, $message, $exchangeArgs = [], $publishArgs = []) {
// ничего не делаем
}
}

View File

@@ -17,5 +17,8 @@ return [
// Для тестов нам не сильно важна безопасность, а вот время прохождения тестов значительно сокращается
'passwordHashCost' => 4,
],
'amqp' => [
'class' => tests\codeception\common\_support\RabbitMQComponent::class,
],
],
];