mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Multiple ORMs for all database
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user