Skip to content

Commit af9a805

Browse files
Separate counting of E_DEPRECATED/E_USER_DEPRECATED from counting of PHPUnit deprecations
1 parent 4643625 commit af9a805

File tree

8 files changed

+22
-9
lines changed

8 files changed

+22
-9
lines changed

src/Runner/TestResult/TestResult.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,24 @@ public function hasDeprecations(): bool
494494

495495
public function hasPhpOrUserDeprecations(): bool
496496
{
497-
return count($this->phpDeprecations) > 0 || count($this->deprecations) > 0;
497+
return $this->numberOfPhpOrUserDeprecations() > 0;
498+
}
499+
500+
public function numberOfPhpOrUserDeprecations(): int
501+
{
502+
return count($this->deprecations) +
503+
count($this->phpDeprecations);
498504
}
499505

500506
public function hasPhpunitDeprecations(): bool
501507
{
502-
return count($this->testTriggeredPhpunitDeprecationEvents) > 0 || count($this->testRunnerTriggeredDeprecationEvents) > 0;
508+
return $this->numberOfPhpunitDeprecations() > 0;
509+
}
510+
511+
public function numberOfPhpunitDeprecations(): int
512+
{
513+
return count($this->testTriggeredPhpunitDeprecationEvents) +
514+
count($this->testRunnerTriggeredDeprecationEvents);
503515
}
504516

505517
public function numberOfDeprecations(): int

src/TextUI/Output/SummaryPrinter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public function print(TestResult $result): void
113113
$this->printCountString($result->numberOfErrors(), 'Errors', $color);
114114
$this->printCountString($result->numberOfTestFailedEvents(), 'Failures', $color);
115115
$this->printCountString($result->numberOfWarnings(), 'Warnings', $color);
116-
$this->printCountString($result->numberOfDeprecations(), 'Deprecations', $color);
116+
$this->printCountString($result->numberOfPhpOrUserDeprecations(), 'Deprecations', $color);
117+
$this->printCountString($result->numberOfPhpunitDeprecations(), 'PHPUnit Deprecations', $color);
117118
$this->printCountString($result->numberOfNotices(), 'Notices', $color);
118119
$this->printCountString($result->numberOfTestSuiteSkippedEvents() + $result->numberOfTestSkippedEvents(), 'Skipped', $color);
119120
$this->printCountString($result->numberOfTestMarkedIncompleteEvents(), 'Incomplete', $color);

tests/end-to-end/migration/possibility-to-migrate-from-100-is-detected.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ There was 1 PHPUnit test runner deprecation:
2525
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
2626

2727
OK, but there were issues!
28-
Tests: 1, Assertions: 1, Deprecations: 1.
28+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/migration/possibility-to-migrate-from-85-is-detected.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ There was 1 PHPUnit test runner deprecation:
2525
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
2626

2727
OK, but there were issues!
28-
Tests: 1, Assertions: 1, Deprecations: 1.
28+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/migration/possibility-to-migrate-from-92-is-detected.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ There was 1 PHPUnit test runner deprecation:
2525
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
2626

2727
OK, but there were issues!
28-
Tests: 1, Assertions: 1, Deprecations: 1.
28+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/migration/possibility-to-migrate-from-95-is-detected.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ There was 1 PHPUnit test runner deprecation:
2525
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
2626

2727
OK, but there were issues!
28-
Tests: 1, Assertions: 1, Deprecations: 1.
28+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/end-to-end/regression/5172.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ There was 1 PHPUnit test runner deprecation:
2828
1) Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!
2929

3030
OK, but there were issues!
31-
Tests: 1, Assertions: 1, Deprecations: 1.
31+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 1.

tests/unit/TextUI/Output/Default/expectations/successful_test_with_phpunit_deprecation.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ message
1212
%s:%i
1313

1414
OK, but there were issues!
15-
Tests: 1, Assertions: 1, Deprecations: 2.
15+
Tests: 1, Assertions: 1, PHPUnit Deprecations: 2.

0 commit comments

Comments
 (0)