Skip to content

Commit d3d14bf

Browse files
Rename hasExpectationOnOutput() to expectsOutput() and extract hasExpectationOnOutput() from it
1 parent db3c410 commit d3d14bf

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/Framework/TestCase.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ final public function hasUnexpectedOutput(): bool
568568
return false;
569569
}
570570

571-
if ($this->hasExpectationOnOutput()) {
571+
if ($this->expectsOutput()) {
572572
return false;
573573
}
574574

@@ -598,9 +598,9 @@ final public function doesNotPerformAssertions(): bool
598598
/**
599599
* @internal This method is not covered by the backward compatibility promise for PHPUnit
600600
*/
601-
final public function hasExpectationOnOutput(): bool
601+
final public function expectsOutput(): bool
602602
{
603-
return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex) || $this->outputRetrievedForAssertion;
603+
return $this->hasExpectationOnOutput() || $this->outputRetrievedForAssertion;
604604
}
605605

606606
/**
@@ -2184,6 +2184,14 @@ private function isRegisteredFailure(Throwable $t): bool
21842184
return false;
21852185
}
21862186

2187+
/**
2188+
* @internal This method is not covered by the backward compatibility promise for PHPUnit
2189+
*/
2190+
private function hasExpectationOnOutput(): bool
2191+
{
2192+
return is_string($this->outputExpectedString) || is_string($this->outputExpectedRegex);
2193+
}
2194+
21872195
/**
21882196
* Creates a test stub for the specified interface or class.
21892197
*

src/Util/PHP/Template/TestCaseClass.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function __phpunit_run_isolated_test()
5858

5959
$output = '';
6060

61-
if (!$test->hasExpectationOnOutput()) {
61+
if (!$test->expectsOutput()) {
6262
$output = $test->output();
6363
}
6464

src/Util/PHP/Template/TestCaseMethod.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function __phpunit_run_isolated_test()
5959

6060
$output = '';
6161

62-
if (!$test->hasExpectationOnOutput()) {
62+
if (!$test->expectsOutput()) {
6363
$output = $test->output();
6464
}
6565

0 commit comments

Comments
 (0)