diff --git a/src/Runner.php b/src/Runner.php index 408aa7a860..7e914775bc 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -791,7 +791,7 @@ public function printProgress(File $file, $numFiles, $numProcessed) $errors = $file->getErrorCount(); $warnings = $file->getWarningCount(); $fixable = $file->getFixableCount(); - $fixed = $file->getFixedCount(); + $fixed = ($file->getFixedErrorCount() + $file->getFixedWarningCount()); if (PHP_CODESNIFFER_CBF === true) { // Files with fixed errors or warnings are F (green). diff --git a/tests/EndToEnd/phpcbf_test.sh b/tests/EndToEnd/phpcbf_test.sh index d8eeae0462..d71669a241 100644 --- a/tests/EndToEnd/phpcbf_test.sh +++ b/tests/EndToEnd/phpcbf_test.sh @@ -26,6 +26,13 @@ function test_phpcbf_returns_error_on_issues() { assert_contains "A TOTAL OF 1 ERROR WERE FIXED IN 1 FILE" "$OUTPUT" } +function test_phpcbf_progressbar_shows_fixes_with_parallel_on() { + OUTPUT="$( { bin/phpcbf --no-colors --parallel=10 --no-cache --suffix=.fixed --standard=tests/EndToEnd/Fixtures/endtoend.xml.dist tests/EndToEnd/Fixtures/ClassWithStyleError.inc; } 2>&1 )" + assert_successful_code + + assert_contains "F 1 / 1 (100%)" "$OUTPUT" +} + function test_phpcbf_bug_1112() { # See https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1112 if [[ "$(uname)" == "Darwin" ]]; then