Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Tree: 4777a4c5a0
Fetching contributors…

Cannot retrieve contributors at this time

56 lines (46 sloc) 1.67 KB
* This file is part of the GenemuFormBundle package.
* (c) Olivier Chauvel <>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
namespace Genemu\Bundle\FormBundle\Tests;
use Doctrine\ODM\MongoDB\Configuration;
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\MongoDB\Connection;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Cache\ArrayCache;
* @author Olivier Chauvel <>
abstract class DoctrineMongoTestCase extends \PHPUnit_Framework_TestCase
protected function setUp()
if (!class_exists('Mongo')) {
$this->markTestSkipped('Mongo PHP/PECL Extension is not available.');
if (!class_exists('Doctrine\\Common\\Version')) {
$this->markTestSkipped('Doctrine is not available.');
* @return EntityManager
public static function createTestDocumentManager($paths = array())
$config = new Configuration();
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), $paths));
$config->setMetadataCacheImpl(new ArrayCache());
return DocumentManager::create(new Connection(), $config);
Jump to Line
Something went wrong with that request. Please try again.