-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialize on mocked object throw error in PHP 7.4 #447
Comments
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);
@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
The text was updated successfully, but these errors were encountered: