Обновление Codeception до 2.3

Подчищен компонент для тестирования AMQP
This commit is contained in:
ErickSkrauch 2017-05-29 14:20:28 +03:00
parent d0a7c08b2c
commit 30fedc51ef
7 changed files with 18 additions and 19 deletions

View File

@ -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",

View File

@ -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'

View File

@ -8,4 +8,4 @@ modules:
config:
Yii2:
configFile: '../config/api/unit.php'
cleanup: false
cleanup: true

View File

@ -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
);
}

View File

@ -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;
}
}

View File

@ -7,4 +7,4 @@ modules:
config:
Yii2:
configFile: '../config/common/unit.php'
cleanup: false
cleanup: true

View File

@ -7,4 +7,4 @@ modules:
config:
Yii2:
configFile: '../config/console/unit.php'
cleanup: false
cleanup: true