[wp-trac] [WordPress Trac] #39822: PHPUnit 6 compatibility
WordPress Trac
noreply at wordpress.org
Sat May 27 20:32:25 UTC 2017
#39822: PHPUnit 6 compatibility
------------------------------+--------------------------
Reporter: miyauchi | Owner: johnbillion
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 4.8
Component: Build/Test Tools | Version:
Severity: normal | Resolution: fixed
Keywords: needs-patch | Focuses:
------------------------------+--------------------------
Comment (by jdgrimes):
Replying to [comment:24 johnbillion]:
> In [changeset:"40539"]:
> {{{
> #!CommitTicketReference repository="" revision="40539"
> Build/Test Tools: Move the `setExpectedException()` method into the
`WP_Ajax_UnitTestCase` class to avoid a fatal error when PHPUnit 3.6 is in
use.
>
> This needs more investigation but it gets the test suite on PHP 5.2
passing again.
>
> See #39822
> }}}
I'm now having issues with this in a plugin, due to the fact that
`is_callable( 'parent::method' )` is apparently not supported on PHP 5.2
when the method is actually on the grandparent.
When using `setExpectedException()` in a testcase extending
`WP_Ajax_UnitTestCase`, I now get this error:
{{{
Fatal error: Call to undefined method
WordPoints_Breaking_Module_Check_Ajax_Test::expectException() in
/tmp/wordpress/tests/phpunit/includes/testcase-ajax.php on line 215
}}}
However, `method_exists( 'PHPUnit_Framework_TestCase',
'setExpectedException' )` would appear to work. See
https://3v4l.org/it5tc#v512
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39822#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list