You should look at
Doctrine\Common\Annotations\AnnotationReader#setAnnotationNamespaceAlias($namespace,
$alias)
That should do the job if you set $namespace = 'orm' and $alias =
'Doctrine\ORM\Mapping'

Give it a try :)

Marco Pivetta
@Ocramius <http://twitter.com/Ocramius>
http://marco-pivetta.com



On 17 May 2011 12:49, defrag <dabrowsk...@gmail.com> wrote:

> 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 symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
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 symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to