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->attach('api.v1.', '/api/v1', function ($map) use($runner, $suite) {
$map->route('tests', '/tests', function ($request, $response)
use($runner, $suite) {
$runner::run($suite); // <-- Error comes here
});
});
How do I proceed on this?
Please help me on this.
Thanks in advance.