File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 55 cacheResult =' false'
66 colors =' true'
77 executionOrder =' default'
8+ failOnEmptyTestSuite =' true'
9+ failOnIncomplete =' true'
810 failOnRisky =' true'
911 failOnWarning =' true'
1012 forceCoversAnnotation =' true'
Original file line number Diff line number Diff line change @@ -87,14 +87,19 @@ public function testDataProvidersKeys(string $className): void
8787 $ dataSet = $ dataProvider ->invoke (null );
8888 \assert ($ dataSet instanceof \Iterator);
8989
90+ $ keyType = null ;
9091 foreach (\array_keys (\iterator_to_array ($ dataSet )) as $ key ) {
91- if (!\is_string ($ key )) {
92- self ::markTestIncomplete (\sprintf (
93- 'Data provider "%s" in class "%s" has non-string keys. ' ,
94- $ dataProvider ->getName (),
95- $ className
96- ));
92+ // based on the type of first key determine what type should be for all keys
93+ if ($ keyType === null ) {
94+ $ keyType = \is_int ($ key ) ? 'int ' : 'string ' ;
9795 }
96+
97+ if (\is_int ($ key )) {
98+ self ::assertSame ('int ' , $ keyType );
99+ continue ;
100+ }
101+
102+ self ::assertSame ('string ' , $ keyType );
98103 self ::assertIsString ($ key );
99104 self ::assertSame (\trim ($ key ), $ key );
100105 self ::assertStringNotContainsString (' ' , $ key );
You can’t perform that action at this time.
0 commit comments