I am trying to implement an PHPUnit integration-test for a Controller. Within the controller I instantiate an Object of the PHPRedis-class (https://github.com/phpredis/phpredis#usage):
//connect to redis database
try
{
$this->objPHPRedis = new \Redis();
$this->objPHPRedis->connect('127.0.0.1');
}
catch(\RedisException $e)
{
$this->log($e, 1);
}
catch (\Exception $e)
{
$this->log($e, 1);
}
This works great when I process normal requests, but it fails when I execute the test:
PHP Fatal error: Class Redis not found in /var/www/.../MyController.php on line 100.
I have no idea where to start searching for the problem. Does anybody have an idea what the problem could be?