Skip to content

Commit

Permalink
Ensure unique data set names in createOptionDataProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Jun 26, 2023
1 parent 93050fb commit 3a6483d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,14 @@ protected function createOptionDataProvider(array $options): array
{
$data = [];

// Loop through each option and get possible values
foreach ($options as $option => $values) {
// Create an option array with a named data provider for each value
foreach ($values as $key => $value) {
$dataKey = $option . '_' . $key;
if (is_int($key)) {
$key = get_debug_type($value);
$dataKey .= '_' . get_debug_type($value);
}

$data[$option . '_' . $key] = [[$option => $value]];
$data[$dataKey] = [[$option => $value]];
}
}

Expand Down

0 comments on commit 3a6483d

Please sign in to comment.