I am writing some unit tests for some services I have on my Symfony2 project. I need to access the services via the service container and I am using this approach:
class DummyTest extends \PHPUnit_Framework_TestCase
{
protected static $kernel;
protected static $container;
public static function setUpBeforeClass()
{
self::$kernel = new \AppKernel('test', true);
self::$kernel->boot();
self::$container = self::$kernel->getContainer();
}
//test cases
}
When $kernel->boot() is called I get the following error: 'MongoCursor' not found in Doctrine/Bundle/MongoDBBundle/DependencyInjection/Configuration.php. I looked into the Configuration.php and there was no reference to MongoCursor. Is this a Bundle's version problem?
Environment: Symfony2.1.6 and DoctrineMongoDBundle's version 2.0.1.