mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-07 18:14:35 +00:00
33 lines
949 B
PHP
33 lines
949 B
PHP
<?php
|
|
|
|
use Alchemy\Phrasea\Model\Entities\UsrAuthProvider;
|
|
|
|
/**
|
|
* @group functional
|
|
* @group legacy
|
|
*/
|
|
class UsrAuthProviderRepositoryTest extends \PhraseanetTestCase
|
|
{
|
|
public function testFindWithProviderAndIdIsNullWhenNotFound()
|
|
{
|
|
$repo = self::$DI['app']['orm.em']->getRepository('Phraseanet:UsrAuthProvider');
|
|
|
|
$this->assertNull($repo->findWithProviderAndId('provider-test', 12345));
|
|
}
|
|
|
|
public function testFindWithProviderAndIdReturnsOneResultWhenFound()
|
|
{
|
|
$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']['orm.em']->persist($auth);
|
|
self::$DI['app']['orm.em']->flush();
|
|
|
|
$this->assertSame($auth, $repo->findWithProviderAndId('provider-test', 12345));
|
|
}
|
|
}
|