Skip to content

Commit

Permalink
Merge pull request #350 from EasyPost/fix_nested_list_scrubbers
Browse files Browse the repository at this point in the history
fix: nested list cassette scrubbers
  • Loading branch information
Justintime50 authored Sep 19, 2024
2 parents 0896a92 + a38cb4b commit 00de74f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
10 changes: 5 additions & 5 deletions test/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ function scrubCassette(mixed $data): mixed
// Root-level list scrubbing
if (InternalUtil::isList($data)) {
foreach ($data as $index => $item) {
if (is_array($index)) {
if (is_array($item)) {
if (array_key_exists($key, $item)) {
$data[$index][$key] = $replacement;
}
if (is_array($item)) {
if (array_key_exists($key, $item)) {
$data[$index][$key] = $replacement;
} else {
$data[$index] = scrubCassette($item);
}
}
}
Expand Down
46 changes: 23 additions & 23 deletions test/cassettes/carrier_accounts/all.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 23 additions & 23 deletions test/cassettes/carrier_accounts/types.yml

Large diffs are not rendered by default.

0 comments on commit 00de74f

Please sign in to comment.