Multiple ORMs for all database

This commit is contained in:
Nicolas Le Goff
2014-10-16 20:00:27 +02:00
parent 007d83fe57
commit 9a3e92ed9c
252 changed files with 2901 additions and 2417 deletions

View File

@@ -6,22 +6,22 @@ class UsrAuthProviderRepositoryTest extends \PhraseanetTestCase
{
public function testFindWithProviderAndIdIsNullWhenNotFound()
{
$repo = self::$DI['app']['EM']->getRepository('Phraseanet:UsrAuthProvider');
$repo = self::$DI['app']['orm.em']->getRepository('Phraseanet:UsrAuthProvider');
$this->assertNull($repo->findWithProviderAndId('provider-test', 12345));
}
public function testFindWithProviderAndIdReturnsOneResultWhenFound()
{
$repo = self::$DI['app']['EM']->getRepository('Phraseanet:UsrAuthProvider');
$repo = self::$DI['app']['orm.em']->getRepository('Phraseanet:UsrAuthProvider');
$auth = new UsrAuthProvider();
$auth->setUser(self::$DI['user']);
$auth->setProvider('provider-test');
$auth->setDistantId(12345);
self::$DI['app']['EM']->persist($auth);
self::$DI['app']['EM']->flush();
self::$DI['app']['orm.em']->persist($auth);
self::$DI['app']['orm.em']->flush();
$this->assertSame($auth, $repo->findWithProviderAndId('provider-test', 12345));
}