Skip to content
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

Mocking serializable classes in PHP 5.5.13 results in exception #339

Closed
cnorthwood opened this issue May 30, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@cnorthwood
Copy link

commented May 30, 2014

Since upgrading to PHP 5.5.13 our test suite has started failing due to a PHP exception:

1) BBC\Knowlearn\Timelines\BamAdapterTest::whenIMakeARequestCorrectBamUrlIsPassed
ErrorException: Erroneous data format for unserializing 'Mockery_2_Guzzle_Http_Message_Response'

/mnt/hgfs/workspace/kandltimelines/vendor/mockery/mockery/library/Mockery/Container.php:435
/mnt/hgfs/workspace/kandltimelines/vendor/mockery/mockery/library/Mockery/Container.php:216
/mnt/hgfs/workspace/kandltimelines/vendor/mockery/mockery/library/Mockery.php:70
/mnt/hgfs/workspace/kandltimelines/app/tests/BBC/Knowlearn/Timelines/BamAdapterTest.php:40`

Here's a sample line to reproduce:

$this->_mockHttpResponse = \Mockery::mock('Guzzle\\Http\\Message\\Response') ->shouldIgnoreMissing();

This test works perfectly on 5.5.12.

I suspect this is related to a similar bug in PHPUnit: sebastianbergmann/phpunit-mock-objects#171

I've had a stab at fixing this but I couldn't quite figure it out, I'm afraid I don't know the Mockery code base well enough.

@cnorthwood

This comment has been minimized.

Copy link
Author

commented May 30, 2014

Found the note, PHP deprecated the way unserialize was being used: php/php-src@3586d14. The php-internals mailing list is currently discussing the breaking change...

garak added a commit to Bee-Lab/bowerphp that referenced this issue Jun 24, 2014

garak added a commit to Bee-Lab/bowerphp that referenced this issue Jun 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.