Hello, im trying to get doctrine2 tests work against database, but
without success. Ive tried approach with creating entity manager:
class UserTest extends \PHPUnit_Framework_TestCase {
private $em = null;
public function setUp()
{
$config = new \Doctrine\ORM\Configuration();
$config->setMetadataCacheImpl(new \Doctrine\Common\Cache
\ArrayCache);
$config->setQueryCacheImpl(new \Doctrine\Common\Cache
\ArrayCache);
$config->setProxyDir(__DIR__ . '/_files');
$config->setProxyNamespace('Proxies');
$config->setMetadataDriverImpl($config-
>newDefaultAnnotationDriver());
$conn = array(
'driver' => 'pdo_sqlite',
'memory' => true,
);
#$config->setSQLLogger(new \Doctrine\DBAL\Logging
\EchoSQLLogger());
$this->em = \Doctrine\ORM\EntityManager::create($conn,
$config);
var_Dump($this->em);
$schemaTool = new \Doctrine\ORM\Tools\SchemaTool($this-
>em);
$schemaTool->createSchema(array(
$this->em->getClassMetadata('Brillante/SampleBundle/
Entity/Account'),
));
}
And ive got error: that given class is not a valid entity or
mapped super class.
Ive figured out that in setUp it creates annotation driver that
required Entity to be mapped as @Entity, not as @orm:Entity. Any idea
how to ovveride this?
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en