Skip to content

Commit

Permalink
Added support for integer type dataset names.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Jul 24, 2024
1 parent f263395 commit dd8bf5a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/Printer.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ public function trace(Event $event): void

$data = $event->test()->testData()->dataFromDataProvider()->dataAsStringForResultOutput();
if (!$this->config->testDpArgs) {
$data = substr($data, 0, 17 + strlen(
$event->test()->testData()->dataFromDataProvider()->dataSetName())
);
$dsn = $event->test()->testData()->dataFromDataProvider()->dataSetName();
$data = substr($data, 0, (is_int($dsn) ? 16 : 17) + strlen((string)$dsn));
}

$id .= $data;
Expand Down
2 changes: 1 addition & 1 deletion test/CapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static function provideData(): iterable
{
return [
'foo' => ['bar'],
'baz' => ['qux'],
['baz'],
];
}

Expand Down
2 changes: 1 addition & 1 deletion test/config/test dp args.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Runtime: %s
Configuration: %s

50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "foo" (%d ms)
100% . [32;1mScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "baz"[0m [32m(%d ms)[0m
100% . [32;1mScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set #0[0m [32m(%d ms)[0m


Time: %s
Expand Down
2 changes: 1 addition & 1 deletion test/functional/data provider.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Runtime: %s
Configuration: %s

50% . ScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "foo" ('bar') (%d ms)
100% . [32;1mScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set "baz" ('qux')[0m [32m(%d ms)[0m
100% . [32;1mScriptFUSIONTest\Pip\CapabilitiesTest::testDataProvider with data set #0 ('baz')[0m [32m(%d ms)[0m


Time: %s
Expand Down

0 comments on commit dd8bf5a

Please sign in to comment.