Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class __PHP_Incomplete_Class has no unserializer

I am trying to run the tests in PHPUnit and getting this error.

Fatal error: Uncaught exception 'ErrorException' with message 'Class __PHP_Incomplete_Class has no unserializer' in /opt/lampp/lib/php/PHPUnit/Util/PHP.php:237

PHP - 5.4.7
PHPUnit - 3.7.21

PHPUnit setting :

processIsolation = "true"

Thanks in advance.

like image 698
Infinity Avatar asked Jun 04 '13 09:06

Infinity


3 Answers

Try clearing the cache for the test environment. php app/console cache:clear --env=test

like image 200
greg Avatar answered Oct 20 '22 16:10

greg


Here's a debugging solution that might help you finding where the unserialize method is failing:

<?php
ini_set('unserialize_callback_func', 'debug_unserialize');

function debug_unserialize($classname) 
{
    die(var_dump($classname));
}

That way you will see which classname is causing problem.

like image 30
Gildas Avatar answered Oct 20 '22 16:10

Gildas


Try opening your site in a browser and then again try to execute the test. I am sure it would work, it seems that there is some difference in cache generation by Php Unit and by Symfony

like image 1
naddy19 Avatar answered Oct 20 '22 18:10

naddy19