mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Компонент RabbitMQ для тестов заменён на заглушку
This commit is contained in:
@ -5,7 +5,6 @@ modules:
|
|||||||
- Yii2
|
- Yii2
|
||||||
- tests\codeception\common\_support\FixtureHelper
|
- tests\codeception\common\_support\FixtureHelper
|
||||||
- Redis
|
- Redis
|
||||||
- AMQP
|
|
||||||
- Asserts
|
- Asserts
|
||||||
- REST:
|
- REST:
|
||||||
depends: Yii2
|
depends: Yii2
|
||||||
@ -17,10 +16,3 @@ modules:
|
|||||||
host: testredis
|
host: testredis
|
||||||
port: 6379
|
port: 6379
|
||||||
database: 0
|
database: 0
|
||||||
AMQP:
|
|
||||||
host: testrabbit
|
|
||||||
port: 5672
|
|
||||||
username: 'ely-accounts-tester'
|
|
||||||
password: 'tester-password'
|
|
||||||
vhost: '/account.ely.by/tests'
|
|
||||||
queues: []
|
|
||||||
|
33
tests/codeception/common/_support/RabbitMQComponent.php
Normal file
33
tests/codeception/common/_support/RabbitMQComponent.php
Normal 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 = []) {
|
||||||
|
// ничего не делаем
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -17,5 +17,8 @@ return [
|
|||||||
// Для тестов нам не сильно важна безопасность, а вот время прохождения тестов значительно сокращается
|
// Для тестов нам не сильно важна безопасность, а вот время прохождения тестов значительно сокращается
|
||||||
'passwordHashCost' => 4,
|
'passwordHashCost' => 4,
|
||||||
],
|
],
|
||||||
|
'amqp' => [
|
||||||
|
'class' => tests\codeception\common\_support\RabbitMQComponent::class,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -9,7 +9,6 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- testdb
|
- testdb
|
||||||
- testredis
|
- testredis
|
||||||
- testrabbit
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./..:/var/www/html
|
- ./..:/var/www/html
|
||||||
environment:
|
environment:
|
||||||
@ -22,11 +21,6 @@ services:
|
|||||||
DB_PASSWORD: "ely_accounts_tester_password"
|
DB_PASSWORD: "ely_accounts_tester_password"
|
||||||
# Redis config
|
# Redis config
|
||||||
REDIS_HOST: "testredis"
|
REDIS_HOST: "testredis"
|
||||||
# RabbitMQ config
|
|
||||||
RABBITMQ_HOST: "testrabbit"
|
|
||||||
RABBITMQ_USER: "ely-accounts-tester"
|
|
||||||
RABBITMQ_PASS: "tester-password"
|
|
||||||
RABBITMQ_VHOST: "/account.ely.by/tests"
|
|
||||||
# Это я потом, когда-нибудь, уберу
|
# Это я потом, когда-нибудь, уберу
|
||||||
XDEBUG_CONFIG: "remote_host=10.254.254.254"
|
XDEBUG_CONFIG: "remote_host=10.254.254.254"
|
||||||
PHP_IDE_CONFIG: "serverName=docker"
|
PHP_IDE_CONFIG: "serverName=docker"
|
||||||
@ -45,11 +39,3 @@ services:
|
|||||||
testredis:
|
testredis:
|
||||||
container_name: accountelyby_testredis
|
container_name: accountelyby_testredis
|
||||||
image: redis:3.0-alpine
|
image: redis:3.0-alpine
|
||||||
|
|
||||||
testrabbit:
|
|
||||||
container_name: accountelyby_testrabbit
|
|
||||||
image: rabbitmq:3.6
|
|
||||||
environment:
|
|
||||||
RABBITMQ_DEFAULT_USER: "ely-accounts-tester"
|
|
||||||
RABBITMQ_DEFAULT_PASS: "tester-password"
|
|
||||||
RABBITMQ_DEFAULT_VHOST: "/account.ely.by/tests"
|
|
||||||
|
Reference in New Issue
Block a user