PHPUnit autoload, class not found - php

I am trying to run unit test in crm Zurmo. Following command entered in console produces errors:
phpunit EmailTemplateTest.php
PHP Fatal error: Class 'ZurmoBaseTest' not found in /zurmo/app/protected/modules/emailTemplates/tests/unit/EmailTemplateTest.php on line 38
Fatal error: Class 'ZurmoBaseTest' not found in /zurmo/app/protected/modules/emailTemplates/tests/unit/EmailTemplateTest.php on line 38
I realize that it's problem with autoload, but don't know how resolve this.

Related

CakePHP - Psr classes not found

I have the following errors:
Fatal error: Interface 'Psr\Http\Message\ServerRequestInterface' not found in /home/www/forex-arts/vendor/cakephp/cakephp/src/Http/ServerRequest.php on line 37
Fatal error: Interface 'Psr\Http\Message\UriInterface' not found in /home/www/forex-arts/vendor/zendframework/zend-diactoros/src/Uri.php on line 25
I am using CakePHP. Does anyone know why I am receiving these errors?

Class 'ZurmoBaseTest' not found in EmailTemplateTest.php

I'm trying to run unit tests on zurmo and I've a problem, when I try the EmailTemplateTest. I get
Fatal error: Class 'ZurmoBaseTest' not found in zurmo\app\protected\
modules\emailTemplates\tests\unit\EmailTemplateTest.php on line 42
If I try to include it with require it fixes this, but then
Fatal error: Class 'BaseTest' not found in zurmo\app\protected\modul
es\zurmo\tests\unit\ZurmoBaseTest.php on line 38
and
Fatal error: Class 'RedBeanDatabase' not found in zurmo\app\protecte
d\core\tests\unit\BaseTest.php on line 44
If I include them both I get the final
Fatal error: Class 'Yii' not found in zurmo\app\protected\core\model
s\RedBeanDatabase.php on line 37
What's the problem? Am I supposed to run it from some exact location or the installation is not default. I installed it with the settup and the app is working itself.
You bootstrap is likely missing the autoloader of your framework and / or your framework's PHPUnit extension.
For anyone else looking for the answer to this one. You should run it via TestSuite.php
phpunit TestSuite.php EmailTemplateTest
TestSuite.php will include the necessary files for you.
http://zurmo.org/tutorials/running-unit-tests-explained

Symfony fatal error on vanilla 2.5.5

I've just installed vanilla Symfony 2.5.5 using composer and got fatal error exception by just visiting app_dev.php:
FatalErrorException: Compile Error: Cannot redeclare class Twig_Node_Expression_Binary_Or in /var/www/symfony/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php line 13
and also
Fatal error: Class 'Twig_Node_Expression_Binary_Sub' not found in /var/www/symfony/vendor/twig/twig/lib/Twig/ExpressionParser.php on line 52
I'm totally puzzled. I've grepped through the symfony but didn't find anything suspicious. This never happened to me before and frankly, I don't have idea what might be the cause of this.

Laravel Setup: Can't install Monolog

I just tried to install a fresh instance of Laravel as described in the docs ( http://laravel.com/docs/quick#installation - "Via Composer"). Got this error from Composer:
...
Writing lock file
Generating autoload files
PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\vendor\laravel\framework\src\Illuminate\Log\LogServiceProvider.php on line 23
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Monolog\\Logger' not found","file":"...\\src\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}Script php artisan clear-c
ompiled handling the post-install-cmd event returned with an error: PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Monolog\\Logger' not found","file":"...\\src\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}Script php artisan optimiz
e handling the post-install-cmd event returned with an error: PHP Fatal error: Class 'Monolog\Logger' not found in ...\src\Illuminate\Log\LogServiceProvider.php on line 23
Uhm, what to do now? Tried to post it on the official forums but that wasn't possible due to an error there (forums are based on Laravel... yeah that's Karma!).
Solution: "composer dumpautoload -o"

Class not found fuelphp oil

i am trying to run fuelphp 1.6 oil on ubuntu server and i get this error message:
PHP Fatal error: Class 'Error' not found in /home/user/public_html/fuel/core/bootstrap.php on line 79
Fatal error: Class 'Error' not found in /home/user/public_html/fuel/core/bootstrap.php on line 79
PHP Fatal error: Class 'Config' not found in /home/user/public_html/fuel/core/bootstrap.php on line 47
Fatal error: Class 'Config' not found in /home/user/public_html/fuel/core/bootstrap.php on line 47
The command i run:
php oil
Any suggestion ?
Probably your autoloader in not correctly configured. This is the first place I would look.
There is nothing to configure in Fuel's autoloader.
FuelPHP uses the COREPATH constant defined in your index.php to find the framework's core classes, and this is defined correctly unless you have changed the location of the files.

Categories