-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
unserialize
when @runInSeparateProcess triggers an error
#1571
Comments
Curious why the output would be a single byte of whitespace. It should contain a serialized array, so there must be some additional problem here. Unfortunately, I can't seem to reproduce the issue with the information you've provided. Would it be possible for you to provide a complete example (maybe as a github repo)? |
I'm trying to use PHPUnit to test quite large application at work, for obvious reasons I can't put it somewhere as a public repo. I'll try to distill it to something usable, but I'm afraid it won't be possible... it's a "legacy" application with structure totally unfit for testing. What I was trying to write weren't even unit tests in the usual sense, I need to set up lots of environment including databases and network etc., so maybe PHPUnit just isn't the tool for the job. |
I am also expericing this problem... investigating... hmm could the reason be caused by a error which also leads to "headers already sent"-errors, e.g. a whitespace after or maybe php startup errors or something like that..? FYI: I am on |
I have exactly the same error, but in a different place:
phpunit 4.6.4 |
I've come across this error also.
PHPUnit 4.0.17 |
Same issue here
|
Dear contributor, let me start by apologizing for not commenting and/or working on the issue you have reported or merging the pull request you have sent sooner. PHPUnit 5.0 was released today. And today I am closing all open bug reports and pull requests for PHPUnit and its dependencies that I maintain. Please do not interpret the closing of this ticket as an insult or a lack of interest in your problem. I am sorry for any inconvenience this may cause. If the topic of this ticket is still relevant then please open a new ticket or send a new pull request. If your ticket or pull request is about a defect then please check whether the issue still exists in PHPUnit 4.8 (which will received bug fixes until August 2016). If your ticket or pull request is about a new feature then please port your patch PHPUnit 5.0 before sending a new pull request. I hope that today's extreme backlog grooming will allow me to respond to bug reports and pull requests in a more timely manner in the future. Thank you for your understanding, |
When I run test in separate process, PHPUnit tries to do some marshalling between the processes. From time to time, I get an
unserialize
offset error, here's an example:After googling around I've found http://www.microtuts.com/php-unserialize-error-at-offset-simple-solution/ and indeed applying this fixed the issue.
Specifically, I've added
trim
beforeunseralize
here: https://github.com/sebastianbergmann/phpunit/blob/master/src/Util/PHP.php#L109The test code can be reduced to this and I can still reproduce the error
I'm no PHP wizzard so I have no idea if the
trim
there can cause any trouble. I'm going to use it in on instance, will report back if I find any troubles with it.The text was updated successfully, but these errors were encountered: