seeResponseMatchesJsonType issue on multiple arrays of arrays
まだ誰も着手していません。
評価
調査の方向性
seeResponseMatchesJsonType エントリポイントから始め、説明されている複数のネストされた配列を使って tests/api/testCest.php:suspendedVenues の失敗を再現します。JSONPath '$..businessHours[i]' の結果がどのようにチェックされるかを追跡します。ネストされた配列内の有効な営業時間オブジェクトがキー欠落エラーを生成しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What are you trying to achieve?
Trying to use seeResponseMatchesJsonType on a response from multiple arrays of arrays
What do you get instead?
After several iterations I get an error
1) testCest: Test Get the SUSPENDED Venues!
Test tests/api/testCest.php:suspendedVenues
Step See response matches json type {"businessHourID":"integer","workingDay":"string","specialHourDate":"string|null","fromTime":"string|null","toTime":"string|null","isClosed":"boolean"},"$..businessHours[22]"
Fail Key `businessHourID` doesn't exist in []
Provide test source code if related
The code I use is
// businessHours array from the venue payload
public static $businessHoursArrayResponse = [
'businessHourID' => 'integer',
'workingDay' => 'string',
'specialHourDate' => 'string|null',
'fromTime' => 'string|null',
'toTime' => 'string|null',
'isClosed' => 'boolean'
];
...
$businessHoursArray = $I->grabDataFromResponseByJsonPath('$..businessHours.*');
for ($i=0; $i < count($businessHoursArray); $i++){
if (!empty($businessHoursArray[$i])) {
$I->seeResponseMatchesJsonType(self::$businessHoursArrayResponse, '$..businessHours['.$i.']');
}
}
var_dump($businessHoursArray) prints an array of 53 valid arrays no missing keys or anything.
Details
- Codeception version: v4.1.20
- PHP Version: 7.2.24
- Operating System: Ubuntu
- Installation type: Phar
- List of installed packages (
composer show) - Suite configuration:
actor: ApiTester
modules:
enabled:
- Asserts
- Helper\Api
- REST:
depends: PhpBrowser
url: '****'
part: Json
curl:
CURLOPT_RETURNTRANSFER: true
- 主要言語
- PHP
- スター
- 60
- フォーク
- 29
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Codeception/module-rest のほかの issue
-
Possible way to `grabFullResponse()` or `grabAllHeaders()`?対応中かも @Azuka が 582 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
Codeception/module-rest#114 · コメント 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
Codeception/module-rest#110 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
Codeception/module-rest#98 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-rest#79 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
Codeception/module-rest#80 · コメント 2 件 ·
Codeception/module-rest の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
taskforcesh/bullmq#5238 ·
メンテナーはふだん 1 日以内に返信
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects it対応中かも @bfs2021 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Automattic/jetpack#55517 ·
メンテナーはふだん 1 日以内に返信
-
Major
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PrestaShop/ps_onepagecheckout#245 ·
メンテナーはふだん 1 日以内に返信
-
wpvc
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
10up/ElasticPress#4420 ·
メンテナーはふだん 1 日以内に返信