Use of static and phpunit in closure causes: Serialization of 'Closure' is not allowed
问题 I am trying to instantiate and start PHPUnitTest from a closure, but I keep getting this message: mytest::authenticate_test Exception: Serialization of 'Closure' is not allowed It works outside a closure without any problems and the route is managed by Aura Router. class mytest extends TestCase { public function authenticate_test() { // ... } } $runner = 'PHPUnit_TextUI_TestRunner'; $suite = new PHPUnit_Framework_TestSuite('PHPUnit'); $suite->addTest(new mytest("authenticate_test")); $map-