@@ -854,24 +854,6 @@ final public function dataSetAsString(): string
854854 return '' ;
855855 }
856856
857- /**
858- * Returns the data set as a string compatible with the --filter CLI option.
859- *
860- * @internal This method is not covered by the backward compatibility promise for PHPUnit
861- */
862- final public function dataSetAsFilterString (): string
863- {
864- if ($ this ->data !== []) {
865- if (is_int ($ this ->dataName )) {
866- return sprintf ('#%d ' , $ this ->dataName );
867- }
868-
869- return sprintf ('%s ' , $ this ->dataName );
870- }
871-
872- return '' ;
873- }
874-
875857 /**
876858 * @internal This method is not covered by the backward compatibility promise for PHPUnit
877859 */
@@ -881,8 +863,9 @@ final public function dataSetAsStringWithData(): string
881863 return '' ;
882864 }
883865
884- return $ this ->dataSetAsString () . sprintf (
885- ' (%s) ' ,
866+ return sprintf (
867+ '%s with data (%s) ' ,
868+ $ this ->dataSetAsFilterString (),
886869 Exporter::shortenedRecursiveExport ($ this ->data ),
887870 );
888871 }
@@ -1284,6 +1267,24 @@ protected function onNotSuccessfulTest(Throwable $t): never
12841267 throw $ t ;
12851268 }
12861269
1270+ /**
1271+ * Returns the data set as a string compatible with the --filter CLI option.
1272+ *
1273+ * @internal This method is not covered by the backward compatibility promise for PHPUnit
1274+ */
1275+ private function dataSetAsFilterString (): string
1276+ {
1277+ if ($ this ->data !== []) {
1278+ if (is_int ($ this ->dataName )) {
1279+ return sprintf ('#%d ' , $ this ->dataName );
1280+ }
1281+
1282+ return sprintf ('@%s ' , $ this ->dataName );
1283+ }
1284+
1285+ return '' ;
1286+ }
1287+
12871288 /**
12881289 * @throws AssertionFailedError
12891290 * @throws Exception
0 commit comments