Skip to content

Commit

Permalink
Apply suggestions from code review - pass 3
Browse files Browse the repository at this point in the history
Co-authored-by: Andreas Möller <[email protected]>
  • Loading branch information
ptomulik and localheinz committed Jun 4, 2020
1 parent ac672fb commit 2516d89
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions tests/unit/Framework/Constraint/UnaryTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down Expand Up @@ -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');
}

/**
Expand Down

0 comments on commit 2516d89

Please sign in to comment.