diff --git a/src/Support/Exporter.php b/src/Support/Exporter.php index 651bec1d..313d081f 100644 --- a/src/Support/Exporter.php +++ b/src/Support/Exporter.php @@ -77,6 +77,12 @@ final class Exporter */ public function shortenedExport(mixed $value): string { - return (string) preg_replace(['#\.{3}#', '#\\\n\s*#'], ['…'], $this->exporter->shortenedExport($value)); + $map = [ + '#\.{3}#' => '…', + '#\\\n\s*#' => '', + '# Object \(…\)#' => '', + ]; + + return (string) preg_replace(array_keys($map), array_values($map), $this->exporter->shortenedExport($value)); } } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 0fda7cb9..aee81e9b 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -80,7 +80,7 @@ ✓ named datasets with dataset "one" ✓ named datasets with dataset "two" ✓ named datasets did the job right - ✓ lazy named datasets with (Bar Object (…)) + ✓ lazy named datasets with (Bar) ✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1 ✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #2 ✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), false) @@ -134,24 +134,24 @@ ✓ eager registered wrapped datasets with Generator functions did the job right ✓ eager registered wrapped datasets with Generator functions display description with dataset "taylor" ✓ eager registered wrapped datasets with Generator functions display description with dataset "james" - ✓ it can resolve a dataset after the test case is available with (Closure Object (…)) #1 - ✓ it can resolve a dataset after the test case is available with (Closure Object (…)) #2 - ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure Object (…)) / (Closure Object (…)) #1 - ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure Object (…)) / (Closure Object (…)) #2 - ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure Object (…)) / (Closure Object (…)) #3 - ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure Object (…)) / (Closure Object (…)) #4 - ✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure Object (…)) #1 - ✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure Object (…)) #2 - ✓ it can resolve a dataset after the test case is available with shared array sets with (Closure Object (…)) #1 - ✓ it can resolve a dataset after the test case is available with shared array sets with (Closure Object (…)) #2 - ✓ it resolves a potential bound dataset logically with ('foo', Closure Object (…)) - ✓ it resolves a potential bound dataset logically even when the closure comes first with (Closure Object (…), 'bar') - ✓ it will not resolve a closure if it is type hinted as a closure with (Closure Object (…)) #1 - ✓ it will not resolve a closure if it is type hinted as a closure with (Closure Object (…)) #2 - ✓ it will not resolve a closure if it is type hinted as a callable with (Closure Object (…)) #1 - ✓ it will not resolve a closure if it is type hinted as a callable with (Closure Object (…)) #2 - ✓ it can correctly resolve a bound dataset that returns an array with (Closure Object (…)) - ✓ it can correctly resolve a bound dataset that returns an array but wants to be spread with (Closure Object (…)) + ✓ it can resolve a dataset after the test case is available with (Closure) #1 + ✓ it can resolve a dataset after the test case is available with (Closure) #2 + ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure) / (Closure) #1 + ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure) / (Closure) #2 + ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure) / (Closure) #3 + ✓ it can resolve a dataset after the test case is available with multiple datasets with (Closure) / (Closure) #4 + ✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure) #1 + ✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure) #2 + ✓ it can resolve a dataset after the test case is available with shared array sets with (Closure) #1 + ✓ it can resolve a dataset after the test case is available with shared array sets with (Closure) #2 + ✓ it resolves a potential bound dataset logically with ('foo', Closure) + ✓ it resolves a potential bound dataset logically even when the closure comes first with (Closure, 'bar') + ✓ it will not resolve a closure if it is type hinted as a closure with (Closure) #1 + ✓ it will not resolve a closure if it is type hinted as a closure with (Closure) #2 + ✓ it will not resolve a closure if it is type hinted as a callable with (Closure) #1 + ✓ it will not resolve a closure if it is type hinted as a callable with (Closure) #2 + ✓ it can correctly resolve a bound dataset that returns an array with (Closure) + ✓ it can correctly resolve a bound dataset that returns an array but wants to be spread with (Closure) ↓ forbids to define tests in Datasets dirs and Datasets.php files PASS Tests\Features\Depends @@ -586,7 +586,7 @@ ✓ it passes with ('Fortaleza') ✓ it passes with ('Sollefteå') ✓ it passes with ('Ιεράπετρα') - ✓ it passes with (stdClass Object (…)) + ✓ it passes with (stdClass) ✓ it passes with array ✓ it passes with *not* ✓ it properly fails with *not*