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