Today my tests are all giving me Serialization of 'Closure' is not allowed
errors. A few days ago they were working fine. This seems odd as I haven't made any real code changes and these methods mostly haven't got any closures in them. Even an empty test method causes the error.
namespace MyCode\Tests;
Class Setup extends \PHPUnit_Framework_TestCase {
public function testSomething(){}
}
The error:
PHPUnit 5.2.10 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 119 ms, Memory: 3.00Mb
There was 1 error:
1) MyCode\Tests\Setup::testSomething
Exception: Serialization of 'Closure' is not allowed
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
[Finished in 0.1s]
So if this error is not coming from this test, where else could it be coming from?
To the best of my knowledge I haven't updated any software recently. I am using PHP7 but as I said this was working fine the other day which was definitely on PHP7.