We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Since 2.x, method seeResponseCodeIs is no longer generating a object ComparisonFailure within the exception when the assertion failed.
This change come from the usage of assertSame instead of assertEquals.
Based on PHPUnit, assertSame generate a ComparisonFailure object only if both values are a string or an array (https://github.com/sebastianbergmann/phpunit/blob/0c37cbcbfdc72425c984460660ac4514918b112e/src/Framework/Constraint/IsIdentical.php#L55 while assertEquals always generate it (https://github.com/sebastianbergmann/phpunit/blob/0c37cbcbfdc72425c984460660ac4514918b112e/src/Framework/Constraint/Equality/IsEqual.php)
Because of this change, the following code no longer works :
try { $this->seeResponseCodeIs(200); } catch (\PHPUnit\Framework\ExpectationFailedException $e) { if ($e->getComparisonFailure()->getActual() === 401) { // Doing something else } }
Is there a reason to use assertSame instead of assertEquals in this case ? Do you think it could be changed ?
Thank you for your time.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
Since 2.x, method seeResponseCodeIs is no longer generating a object ComparisonFailure within the exception when the assertion failed.
This change come from the usage of assertSame instead of assertEquals.
Based on PHPUnit, assertSame generate a ComparisonFailure object only if both values are a string or an array (https://github.com/sebastianbergmann/phpunit/blob/0c37cbcbfdc72425c984460660ac4514918b112e/src/Framework/Constraint/IsIdentical.php#L55 while assertEquals always generate it (https://github.com/sebastianbergmann/phpunit/blob/0c37cbcbfdc72425c984460660ac4514918b112e/src/Framework/Constraint/Equality/IsEqual.php)
Because of this change, the following code no longer works :
Is there a reason to use assertSame instead of assertEquals in this case ? Do you think it could be changed ?
Thank you for your time.
The text was updated successfully, but these errors were encountered: