[wp-trac] [WordPress Trac] #38853: WordPress Test Suite causes Fatal Error when used for Theme Testing

WordPress Trac noreply at wordpress.org
Sat Nov 19 01:57:38 UTC 2016


#38853: WordPress Test Suite causes Fatal Error when used for Theme Testing
-------------------------------------+------------------------------
 Reporter:  michaeltaheri            |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  General                  |     Version:  trunk
 Severity:  normal                   |  Resolution:
 Keywords:  close reporter-feedback  |     Focuses:
-------------------------------------+------------------------------
Description changed by SergeyBiryukov:

Old description:

> I have been playing with Theme Unit Testing using WP_UnitTestCase for
> some days, And I might have find an issue here:
> http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/
>
> It seems a change in testcase.php (line 238) now causes a fatal error
> when you run phpunit "Fatal error: __clone method called on non-object"
>
> I have tested this in different situations and systems all with same
> result, This even happen with WordPress default Theme.
>
> I know that WP_UnitTestCase is not designed for Theme Testing but this
> can be resolved simply by using an "is_object( $hook_object )" condition.
>
> If anyone is wondering how Theme Testing works using WP_UnitTestCase
> [https://nerds.inn.org/2014/10/22/unit-testing-themes-and-plugins-in-
> wordpress/ here's a good start]

New description:

 I have been playing with Theme Unit Testing using WP_UnitTestCase for some
 days, And I might have find an issue here:
 http://develop.svn.wordpress.org/trunk/tests/phpunit/includes/

 It seems a change in testcase.php (line 238) now causes a fatal error when
 you run phpunit `Fatal error: __clone method called on non-object`

 I have tested this in different situations and systems all with same
 result, This even happen with WordPress default Theme.

 I know that WP_UnitTestCase is not designed for Theme Testing but this can
 be resolved simply by using an `is_object( $hook_object )` condition.

 If anyone is wondering how Theme Testing works using WP_UnitTestCase
 [https://nerds.inn.org/2014/10/22/unit-testing-themes-and-plugins-in-
 wordpress/ here's a good start]

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38853#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list