From ff3f1c566b4f9818304a51398e1bb4a046e193d5 Mon Sep 17 00:00:00 2001 From: Rudolf Halas Date: Wed, 15 Nov 2017 18:06:42 +0100 Subject: [PATCH] Added test counter to each row. --- src/Printer.php | 6 +++--- tests/duration-test.phpt | 4 ++-- tests/names-test.phpt | 10 +++++----- tests/states-test.phpt | 14 +++++++------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Printer.php b/src/Printer.php index 12a34bb..9600b29 100644 --- a/src/Printer.php +++ b/src/Printer.php @@ -38,13 +38,13 @@ class Printer extends ResultPrinter */ protected function writeProgress($progress) { + $this->numTestsRun++; + if ($this->hasReplacementSymbol($progress)) { $progress = static::$symbols[$progress]; } - $this->write("{$progress} {$this->testRow}" . PHP_EOL); - $this->column++; - $this->numTestsRun++; + $this->write("({$this->numTestsRun}/{$this->numTests}) {$progress} {$this->testRow}" . PHP_EOL); } /** diff --git a/tests/duration-test.phpt b/tests/duration-test.phpt index 516bd01..79d0ee4 100644 --- a/tests/duration-test.phpt +++ b/tests/duration-test.phpt @@ -15,8 +15,8 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -✔ PrinterDurationTest: Test Short (%s ms) -✔ PrinterDurationTest: Test Long (%s ms) +(1/2) ✔ PrinterDurationTest: Test Short (%s ms) +(2/2) ✔ PrinterDurationTest: Test Long (%s ms) Time: %s, Memory: %sMB diff --git a/tests/names-test.phpt b/tests/names-test.phpt index 0a144f9..34967f7 100644 --- a/tests/names-test.phpt +++ b/tests/names-test.phpt @@ -15,11 +15,11 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -✔ PrinterNamesTest: Test It Supports Camel Case (%s ms) -✔ PrinterNamesTest: Test It Supports Camel Case With CAPS Parts (%s ms) -✔ PrinterNamesTest: It supports snake case (%s ms) -✔ PrinterNamesTest: Itworkswithoutspacesaswell (%s ms) -✔ PrinterNamesTest: Test Supports whatever Case (%s ms) +(1/5) ✔ PrinterNamesTest: Test It Supports Camel Case (%s ms) +(2/5) ✔ PrinterNamesTest: Test It Supports Camel Case With CAPS Parts (%s ms) +(3/5) ✔ PrinterNamesTest: It supports snake case (%s ms) +(4/5) ✔ PrinterNamesTest: Itworkswithoutspacesaswell (%s ms) +(5/5) ✔ PrinterNamesTest: Test Supports whatever Case (%s ms) Time: %s, Memory: %sMB diff --git a/tests/states-test.phpt b/tests/states-test.phpt index 22ab606..8cac3b8 100644 --- a/tests/states-test.phpt +++ b/tests/states-test.phpt @@ -15,13 +15,13 @@ PHPUnit\TextUI\Command::main(); --EXPECTF-- PHPUnit %s by Sebastian Bergmann and contributors. -✔ PrinterStatesTest: Test Success (%s ms) -✖ PrinterStatesTest: Test Failure (%s ms) -! PrinterStatesTest: Test Error (%s ms) -S PrinterStatesTest: Test Skipped (%s ms) -W PrinterStatesTest: Test Warning (%s ms) -R PrinterStatesTest: Test Risky (%s ms) -I PrinterStatesTest: Test Incomplete (%s ms) +(1/7) ✔ PrinterStatesTest: Test Success (%s ms) +(2/7) ✖ PrinterStatesTest: Test Failure (%s ms) +(3/7) ! PrinterStatesTest: Test Error (%s ms) +(4/7) S PrinterStatesTest: Test Skipped (%s ms) +(5/7) W PrinterStatesTest: Test Warning (%s ms) +(6/7) R PrinterStatesTest: Test Risky (%s ms) +(7/7) I PrinterStatesTest: Test Incomplete (%s ms) Time: %s, Memory: %sMB