Skip to content

Commit 00de74f

Browse files
authored
Merge pull request #350 from EasyPost/fix_nested_list_scrubbers
fix: nested list cassette scrubbers
2 parents 0896a92 + a38cb4b commit 00de74f

File tree

3 files changed

+51
-51
lines changed

3 files changed

+51
-51
lines changed

test/bootstrap.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ function scrubCassette(mixed $data): mixed
6969
// Root-level list scrubbing
7070
if (InternalUtil::isList($data)) {
7171
foreach ($data as $index => $item) {
72-
if (is_array($index)) {
73-
if (is_array($item)) {
74-
if (array_key_exists($key, $item)) {
75-
$data[$index][$key] = $replacement;
76-
}
72+
if (is_array($item)) {
73+
if (array_key_exists($key, $item)) {
74+
$data[$index][$key] = $replacement;
75+
} else {
76+
$data[$index] = scrubCassette($item);
7777
}
7878
}
7979
}

test/cassettes/carrier_accounts/all.yml

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cassettes/carrier_accounts/types.yml

+23-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)