File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -231,19 +231,19 @@ private function dataProvidedByMetadata(MetadataCollection $testWith): array
231
231
{
232
232
$ result = [];
233
233
234
- $ providerLabel = 'TestWith attribute ' ;
235
-
236
- foreach ($ testWith as $ _testWith ) {
234
+ foreach ($ testWith as $ i => $ _testWith ) {
237
235
assert ($ _testWith instanceof TestWith);
236
+ $ providerLabel = sprintf ('TestWith#%s attribute ' , $ i );
238
237
239
238
if ($ _testWith ->hasName ()) {
240
239
$ key = $ _testWith ->name ();
241
240
242
241
if (array_key_exists ($ key , $ result )) {
243
242
throw new InvalidDataProviderException (
244
243
sprintf (
245
- 'The key "%s" has already been defined by a previous TestWith attribute ' ,
244
+ 'The key "%s" has already been defined by %s ' ,
246
245
$ key ,
246
+ $ result [$ key ]->getProviderLabel (),
247
247
),
248
248
);
249
249
}
Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ public function testTestWithAttribute(): void
195
195
public function testTestWithAttributeWithDuplicateKey (): void
196
196
{
197
197
$ this ->expectException (InvalidDataProviderException::class);
198
- $ this ->expectExceptionMessage ('The key "foo" has already been defined by a previous TestWith attribute ' );
198
+ $ this ->expectExceptionMessage ('The key "foo" has already been defined by TestWith#0 attribute ' );
199
199
200
200
/* @noinspection UnusedFunctionResultInspection */
201
201
(new DataProvider )->providedData (TestWithAttributeDataProviderTest::class, 'testWithDuplicateName ' );
You can’t perform that action at this time.
0 commit comments