chore: skip array list

This commit is contained in:
Maurizio
2023-08-19 10:27:02 +02:00
parent 478144fb35
commit f8dd286213
5 changed files with 32 additions and 4 deletions

View File

@ -753,7 +753,9 @@ final class Expectation
} }
foreach ($this->value as $k => $item) { foreach ($this->value as $k => $item) {
$this->and($k)->toBeSnakeCase($message); if (is_string($k)) {
$this->and($k)->toBeSnakeCase($message);
}
if (is_array($item)) { if (is_array($item)) {
$this->and($item)->toHaveSnakeCaseKeys($message); $this->and($item)->toHaveSnakeCaseKeys($message);
@ -775,7 +777,9 @@ final class Expectation
} }
foreach ($this->value as $k => $item) { foreach ($this->value as $k => $item) {
$this->and($k)->toBeKebabCase($message); if (is_string($k)) {
$this->and($k)->toBeKebabCase($message);
}
if (is_array($item)) { if (is_array($item)) {
$this->and($item)->toHaveKebabCaseKeys($message); $this->and($item)->toHaveKebabCaseKeys($message);
@ -797,7 +801,9 @@ final class Expectation
} }
foreach ($this->value as $k => $item) { foreach ($this->value as $k => $item) {
$this->and($k)->toBeCamelCase($message); if (is_string($k)) {
$this->and($k)->toBeCamelCase($message);
}
if (is_array($item)) { if (is_array($item)) {
$this->and($item)->toHaveCamelCaseKeys($message); $this->and($item)->toHaveCamelCaseKeys($message);
@ -819,7 +825,9 @@ final class Expectation
} }
foreach ($this->value as $k => $item) { foreach ($this->value as $k => $item) {
$this->and($k)->toBeStudlyCase($message); if (is_string($k)) {
$this->and($k)->toBeStudlyCase($message);
}
if (is_array($item)) { if (is_array($item)) {
$this->and($item)->toHaveStudlyCaseKeys($message); $this->and($item)->toHaveStudlyCaseKeys($message);

View File

@ -11,6 +11,11 @@ $array = [
'camel' => true, 'camel' => true,
'camelCase' => true, 'camelCase' => true,
], ],
'list' => [
'abc',
'def',
'ghi',
],
], ],
]; ];

View File

@ -11,6 +11,11 @@ $array = [
'kebab' => true, 'kebab' => true,
'kebab-case' => true, 'kebab-case' => true,
], ],
'list' => [
'abc',
'def',
'ghi',
],
], ],
]; ];

View File

@ -11,6 +11,11 @@ $array = [
'snake' => true, 'snake' => true,
'snake_case' => true, 'snake_case' => true,
], ],
'list' => [
'abc',
'def',
'ghi',
],
], ],
]; ];

View File

@ -11,6 +11,11 @@ $array = [
'Studly' => true, 'Studly' => true,
'StudlyCase' => true, 'StudlyCase' => true,
], ],
'List' => [
'abc',
'def',
'ghi',
],
], ],
]; ];