mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00
29 lines
913 B
PHP
29 lines
913 B
PHP
<?php
|
|
|
|
use Alchemy\Phrasea\Model\Entities\UsrAuthProvider;
|
|
|
|
class UsrAuthProviderRepositoryTest extends \PhraseanetTestCase
|
|
{
|
|
public function testFindWithProviderAndIdIsNullWhenNotFound()
|
|
{
|
|
$repo = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider');
|
|
|
|
$this->assertNull($repo->findWithProviderAndId('provider-test', 12345));
|
|
}
|
|
|
|
public function testFindWithProviderAndIdReturnsOneResultWhenFound()
|
|
{
|
|
$repo = self::$DI['app']['EM']->getRepository('Alchemy\Phrasea\Model\Entities\UsrAuthProvider');
|
|
|
|
$auth = new UsrAuthProvider();
|
|
$auth->setUsrId(42);
|
|
$auth->setProvider('provider-test');
|
|
$auth->setDistantId(12345);
|
|
|
|
self::$DI['app']['EM']->persist($auth);
|
|
self::$DI['app']['EM']->flush();
|
|
|
|
$this->assertSame($auth, $repo->findWithProviderAndId('provider-test', 12345));
|
|
}
|
|
}
|