From 3a6483d26343319d3f16e6a0de870f1fbe8c0fec Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Mon, 26 Jun 2023 08:43:26 +0200 Subject: [PATCH] Ensure unique data set names in createOptionDataProvider --- tests/TestCase.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/TestCase.php b/tests/TestCase.php index 7c77d7df4..0de87b0a1 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -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]]; } }