Related to #4467 and 1dba8c3
I'm currently looking at polyfilling the assertObjectEquals() assertion for the PHPUnit Polyfills.
As things stand, the assertion does a check on the $method to make sure that:
- a return type is declared and
- this return type is not nullable and
- this return type is of type
bool
This prohibits the writing of PHP/PHPUnit cross-version compatible code using comparator methods, where PHP < 7.0 still has to be supported. (yeah, I know, don't get me started....).
The thing is, if I look at the implementation, that check should not have to be a blocker.
If the return type check is removed and replaced by a check that the output of $other->{$this->method}($this->expected) is of type boolean before checking that the value is true, this part of the assertion is still safeguarded, while not blocking cross-version code.
Would a change to this effect be deemed acceptable ? If so, I'd be willing to create the PR for it.
Related to #4467 and 1dba8c3
I'm currently looking at polyfilling the
assertObjectEquals()assertion for the PHPUnit Polyfills.As things stand, the assertion does a check on the
$methodto make sure that:boolThis prohibits the writing of PHP/PHPUnit cross-version compatible code using comparator methods, where PHP < 7.0 still has to be supported. (yeah, I know, don't get me started....).
The thing is, if I look at the implementation, that check should not have to be a blocker.
If the return type check is removed and replaced by a check that the output of
$other->{$this->method}($this->expected)is of type boolean before checking that the value istrue, this part of the assertion is still safeguarded, while not blocking cross-version code.Would a change to this effect be deemed acceptable ? If so, I'd be willing to create the PR for it.