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

@@ -8,20 +8,20 @@ class UserRepositoryTest extends \PhraseanetTestCase
{
public function testFindAdminsWithNoAdmins()
{
$users = self::$DI['app']['EM']->getRepository('Phraseanet:User')->findAdmins();
$users = self::$DI['app']['orm.em']->getRepository('Phraseanet:User')->findAdmins();
$this->assertEquals(2, count($users));
}
public function testFindByLogin()
{
$user = self::$DI['app']['EM']->getRepository('Phraseanet:User')->findByLogin('user1');
$user = self::$DI['app']['orm.em']->getRepository('Phraseanet:User')->findByLogin('user1');
$this->assertInstanceOf('Alchemy\Phrasea\Model\Entities\User', $user);
$this->assertNull(self::$DI['app']['EM']->getRepository('Phraseanet:User')->findByLogin('wrong-login'));
$this->assertNull(self::$DI['app']['orm.em']->getRepository('Phraseanet:User')->findByLogin('wrong-login'));
}
public function testFindUserByEmail()
{
$user = self::$DI['app']['EM']->getRepository('Phraseanet:User')->findByEmail('user2@phraseanet.com');
$user = self::$DI['app']['orm.em']->getRepository('Phraseanet:User')->findByEmail('user2@phraseanet.com');
$this->assertInstanceOf('Alchemy\Phrasea\Model\Entities\User', $user);
}
}