Open alexander-schranz opened 5 years ago
Why are you serialising the prophet before revealing? Can you expand on the use case?
Sorry it is revealed updated the example.
Same here, after upgrading to PHP 7.4 the error came up. It worked just fine on PHP 7.2
$site = $this->prophesize(Site::class);
$branch = $this->prophesize(Branch::class);
$url = 'http://fake.url';
$event = new NewUrlAddressFound($site->reveal(), $branch->reveal(), $url);
$serialized = serialize($event);
Exception: Serialization of 'Closure' is not allowed
@alexander-schranz did you managed to solve the issue?
@geodeveloper I refractored the tests and avoided to mock that objects and created real instances of that objects. So I learned for myself avoid mocks where it is possible.
@alexander-schranz I ended doing that too, avoiding serializing mock objects. Thanks for your time!
When in PHP 7.4 a mocked object get serialized e.g.:
The following exception is thrown:
Related PHP migration: https://www.php.net/manual/de/migration74.incompatible.php