1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00

Migrate getRepository with entities

This commit is contained in:
Yassine Guedidi 2022-08-25 21:37:10 +02:00
parent 50a941d8b4
commit 8b7b4975d6
38 changed files with 226 additions and 202 deletions

View file

@ -7,6 +7,7 @@ use Symfony\Component\Console\Tester\CommandTester;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Command\GenerateUrlHashesCommand;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
{
@ -66,7 +67,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
$this->logInAs('admin');
$user = $em->getRepository('WallabagUserBundle:User')->findOneById($this->getLoggedInUserId());
$user = $em->getRepository(User::class)->findOneById($this->getLoggedInUserId());
$entry1 = new Entry($user);
$entry1->setUrl($url);
@ -87,7 +88,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
$this->assertStringContainsString('Generated hashed urls for user: admin', $tester->getDisplay());
$entry = $em->getRepository('WallabagCoreBundle:Entry')->findOneByUrl($url);
$entry = $em->getRepository(Entry::class)->findOneByUrl($url);
$this->assertSame($entry->getHashedUrl(), hash('sha1', $url));