I am trying to use phpunit
with Laravel 4, but I have Mcrypt problem.
At vendor/laravel/framework/src/Illuminate/Foundation/start.php
line 29, Laravel checks to see if mcrypt
is enabled.
if ( ! extension_loaded('mcrypt'))
{
die('Laravel requires the Mcrypt PHP extension.'.PHP_EOL);
exit(1);
}
When I phpunit
at CLI, it says;
Laravel requires the Mcrypt PHP extension.
This is not possible because following commands show that everything is OK.
$ php -v
PHP 5.4.4 (cli)
$ php --ini
Loaded Configuration File: /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
$ php -i | grep "mcrypt support"
mcrypt support => enabled
But... When I add following code at vendor/laravel/framework/src/Illuminate/Foundation/start.php
to see which PHP version is used, CLI displays 5.3.15
die(phpversion().PHP_EOL);
I don't know how this could be possible.
After adding the above code; php artisan
displays 5.4.4 but phpunit
displays 5.3.15. This is nearly impossible because both use vendor/laravel/framework/src/Illuminate/Foundation/start.php
to check if Mcrypt is enabled.
I'm not sure but does Laravel change something when it's in testing
environment?