[wp-trac] [WordPress Trac] #50482: Uncaught Exception: Serialization of 'Closure' is not allowed when run PHPUnit in plugin development

WordPress Trac noreply at wordpress.org
Thu Oct 1 16:28:14 UTC 2020


#50482: Uncaught Exception: Serialization of 'Closure' is not allowed when run
PHPUnit in plugin development
------------------------------+-----------------------
 Reporter:  yshinoda          |       Owner:  (none)
     Type:  defect (bug)      |      Status:  reopened
 Priority:  normal            |   Milestone:  5.5.2
Component:  Build/Test Tools  |     Version:  5.5
 Severity:  critical          |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+-----------------------

Comment (by auth0josh):

 I'm having this problem as well. Only a few of our tests annotated with
 `@runInSeparateProcess` and adding `@preserveGlobalState` as an annotating
 to those or globally with the phpunit configuration file did not make a
 difference. Running tests against 5.4.2 passes but 5.5 or latest errors
 for all tests:

 {{{
 EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE  63 / 416
 ( 15%)
 EEEEEEEEEEE
 Fatal error: Uncaught Exception: Serialization of 'Closure' is not allowed
 in /Users/josh-cunningham/Sites/wp-auth0/wp-
 content/plugins/auth0/vendor/phpunit/phpunit/src/Util/GlobalState.php on
 line 175

 Exception: Serialization of 'Closure' is not allowed in /Users/josh-
 cunningham/Sites/wp-auth0/wp-
 content/plugins/auth0/vendor/phpunit/phpunit/src/Util/GlobalState.php on
 line 175
 }}}

 We're going to release an update marked as tested up to 5.4.2 and adjust
 our CI for now but it would be good to know if there's something we can do
 differently or if this needs to be changed in core.

 Plugin repo is below, happy to help test!

 https://github.com/auth0/wp-auth0

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


More information about the wp-trac mailing list