123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- /*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
- namespace Symfony\Bundle\DoctrineMongoDBBundle\Tests;
- use Doctrine\ODM\MongoDB\DocumentManager;
- use Doctrine\MongoDB\Connection;
- class TestCase extends \PHPUnit_Framework_TestCase
- {
- protected function setUp()
- {
- if (!class_exists('Doctrine\\ODM\\MongoDB\\Version')) {
- $this->markTestSkipped('Doctrine MongoDB ODM is not available.');
- }
- }
- /**
- * @return DocumentManager
- */
- protected function createTestDocumentManager($paths = array())
- {
- $config = new \Doctrine\ODM\MongoDB\Configuration();
- $config->setAutoGenerateProxyClasses(true);
- $config->setProxyDir(\sys_get_temp_dir());
- $config->setHydratorDir(\sys_get_temp_dir());
- $config->setProxyNamespace('SymfonyTests\Doctrine');
- $config->setHydratorNamespace('SymfonyTests\Doctrine');
- $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver($paths));
- $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
- return DocumentManager::create(new Connection(), 'test', $config);
- }
- }
|