diff --git a/tests/unit/Framework/Constraint/UnaryTestCase.php b/tests/unit/Framework/Constraint/UnaryTestCase.php index e28ae1f5826..0444300c1e0 100644 --- a/tests/unit/Framework/Constraint/UnaryTestCase.php +++ b/tests/unit/Framework/Constraint/UnaryTestCase.php @@ -112,7 +112,7 @@ public function testNonRestrictedConstructParameterIsTreatedAsIsEqual(): void public function providerUnaryTruthTable() { - return \array_map(function (bool $input) { + return \array_map(function (bool $input): array { return [$input, $this->evaluateExpectedResult($input)]; }, [false, true]); } @@ -145,13 +145,15 @@ public function testEvaluateReturnsNullOnSuccessAndThrowsExceptionOnFailure(bool if ($expected) { $this->assertNull($constraint->evaluate(null)); - } else { - $expectedString = $operand->toString(); - $message = "Failed asserting that 'the following expression is not true' " . $expectedString; - $this->expectException(ExpectationFailedException::class); - $this->expectExceptionMessage($message); - $constraint->evaluate('the following expression is true'); + + return; } + + $expectedString = $operand->toString(); + $message = "Failed asserting that 'the following expression is not true' " . $expectedString; + $this->expectException(ExpectationFailedException::class); + $this->expectExceptionMessage($message); + $constraint->evaluate('the following expression is true'); } /**