Class __PHP_Incomplete_Class has no unserializer
19,095
Solution 1
Try clearing the cache for the test environment. php app/console cache:clear --env=test
Solution 2
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.
Solution 3
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
Related videos on Youtube
Author by
Infinity
Updated on June 04, 2022Comments
-
Infinity almost 2 years
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.
-
Pudge601 almost 11 yearsHave you tried googling this? google.co.uk/… Seems to be an issue specific to PHPUnit and symfony2
-
-
Infinity almost 11 yearsThanks, but it did not work, I know the reason but i am not sure about it since i do not have any solution to it. This problem is due do the "GLOBALS" handling differently in PHP and PHPUNIT, i have even tried out this option(phpunit.de/manual/3.7/en/…)
-
MW Millar about 6 yearsUseful command. However, my output shows a class that does not exist. Any ideas on why that would be? I have a feeling it is due to something gone wrong with composer or the cache, but I have cleared both and re-installed composer packages