Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (44 sloc) 1.668 kB
* This file is part of the Doctrine MongoDBBundle
* The code was originally distributed inside the Symfony framework.
* (c) Fabien Potencier <>
* (c) Doctrine Project
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
namespace Doctrine\Bundle\MongoDBBundle\Tests;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\MongoDB\Connection;
use Doctrine\ODM\MongoDB\DocumentManager;
use Doctrine\ODM\MongoDB\Mapping\Driver\AnnotationDriver;
class TestCase extends \PHPUnit_Framework_TestCase
protected function setUp()
if (!class_exists('Mongo')) {
$this->markTestSkipped('Mongo PHP/PECL Extension is not available.');
if (!class_exists('Doctrine\\ODM\\MongoDB\\Version')) {
$this->markTestSkipped('Doctrine MongoDB ODM is not available.');
* @return DocumentManager
public static function createTestDocumentManager($paths = array())
$config = new \Doctrine\ODM\MongoDB\Configuration();
$config->setMetadataDriverImpl(new AnnotationDriver(new AnnotationReader(), $paths));
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
return DocumentManager::create(new Connection(), $config);
Jump to Line
Something went wrong with that request. Please try again.