mirror of
https://github.com/elyby/accounts.git
synced 2024-11-09 23:12:20 +05:30
Обновление Codeception до 2.3
Подчищен компонент для тестирования AMQP
This commit is contained in:
parent
d0a7c08b2c
commit
30fedc51ef
@ -37,7 +37,8 @@
|
||||
"yiisoft/yii2-debug": "*",
|
||||
"yiisoft/yii2-faker": "*",
|
||||
"flow/jsonpath": "^0.3.1",
|
||||
"codeception/codeception": "2.2.10",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"codeception/codeception": "~2.3",
|
||||
"codeception/specify": "*",
|
||||
"codeception/verify": "*",
|
||||
"phploc/phploc": "^3.0.1",
|
||||
|
@ -12,8 +12,9 @@ modules:
|
||||
config:
|
||||
Yii2:
|
||||
configFile: '../config/api/functional.php'
|
||||
cleanup: false
|
||||
cleanup: true
|
||||
Redis:
|
||||
host: "%REDIS_HOST%"
|
||||
port: 6379
|
||||
database: 0
|
||||
cleanupBefore: 'test'
|
||||
|
@ -8,4 +8,4 @@ modules:
|
||||
config:
|
||||
Yii2:
|
||||
configFile: '../config/api/unit.php'
|
||||
cleanup: false
|
||||
cleanup: true
|
||||
|
@ -28,12 +28,9 @@ class Helper extends Module {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: заменить на assertCount() после релиза Codeception 2.2.7
|
||||
// https://github.com/Codeception/Codeception/pull/3802
|
||||
/** @noinspection PhpUnitTestsInspection */
|
||||
$this->assertEquals(
|
||||
$this->assertCount(
|
||||
$num,
|
||||
count($this->grabSentAmqpMessages($exchange)),
|
||||
$this->grabSentAmqpMessages($exchange),
|
||||
'number of created messages is equal to ' . $num
|
||||
);
|
||||
}
|
||||
|
@ -43,16 +43,16 @@ class TestComponent extends Component {
|
||||
public function getSentMessages(string $exchangeName = null) : array {
|
||||
if ($exchangeName !== null) {
|
||||
return $this->sentMessages[$exchangeName] ?? [];
|
||||
} else {
|
||||
$messages = [];
|
||||
foreach($this->sentMessages as $exchangeGroup) {
|
||||
foreach ($exchangeGroup as $message) {
|
||||
$messages[] = $message;
|
||||
}
|
||||
}
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
$messages = [];
|
||||
foreach($this->sentMessages as $exchangeGroup) {
|
||||
foreach ($exchangeGroup as $message) {
|
||||
$messages[] = $message;
|
||||
}
|
||||
}
|
||||
|
||||
return $messages;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,4 +7,4 @@ modules:
|
||||
config:
|
||||
Yii2:
|
||||
configFile: '../config/common/unit.php'
|
||||
cleanup: false
|
||||
cleanup: true
|
||||
|
@ -7,4 +7,4 @@ modules:
|
||||
config:
|
||||
Yii2:
|
||||
configFile: '../config/console/unit.php'
|
||||
cleanup: false
|
||||
cleanup: true
|
||||
|
Loading…
Reference in New Issue
Block a user