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

@ -24,7 +24,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
{
$annotationRows = $this
->getDoctrine()
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
$total = \count($annotationRows);
$annotations = ['total' => $total, 'rows' => $annotationRows];

View file

@ -19,7 +19,7 @@ class DeveloperController extends Controller
*/
public function indexAction()
{
$clients = $this->getDoctrine()->getRepository('WallabagApiBundle:Client')->findByUser($this->getUser()->getId());
$clients = $this->getDoctrine()->getRepository(Client::class)->findByUser($this->getUser()->getId());
return $this->render('@WallabagCore/themes/common/Developer/index.html.twig', [
'clients' => $clients,

View file

@ -44,7 +44,7 @@ class EntryRestController extends WallabagRestController
public function getEntriesExistsAction(Request $request)
{
$this->validateAuthentication();
$repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
$repo = $this->getDoctrine()->getRepository(Entry::class);
$returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id');
@ -753,7 +753,7 @@ class EntryRestController extends WallabagRestController
$label = trim($label);
$tag = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findOneByLabel($label);
if (false !== $tag) {

View file

@ -22,7 +22,7 @@ class TagRestController extends WallabagRestController
$this->validateAuthentication();
$tags = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findAllTags($this->getUser()->getId());
$json = $this->get('jms_serializer')->serialize($tags, 'json');
@ -46,7 +46,7 @@ class TagRestController extends WallabagRestController
$this->validateAuthentication();
$label = $request->get('tag', '');
$tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$label], $this->getUser()->getId());
$tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$label], $this->getUser()->getId());
if (empty($tags)) {
throw $this->createNotFoundException('Tag not found');
@ -55,7 +55,7 @@ class TagRestController extends WallabagRestController
$tag = $tags[0];
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);
@ -82,14 +82,14 @@ class TagRestController extends WallabagRestController
$tagsLabels = $request->get('tags', '');
$tags = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
$tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
if (empty($tags)) {
throw $this->createNotFoundException('Tags not found');
}
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->removeTags($this->getUser()->getId(), $tags);
$this->cleanOrphanTag($tags);
@ -114,14 +114,14 @@ class TagRestController extends WallabagRestController
{
$this->validateAuthentication();
$tagFromDb = $this->getDoctrine()->getRepository('WallabagCoreBundle:Tag')->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
$tagFromDb = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
if (empty($tagFromDb)) {
throw $this->createNotFoundException('Tag not found');
}
$this->getDoctrine()
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->removeTag($this->getUser()->getId(), $tag);
$this->cleanOrphanTag($tag);

View file

@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Helper\UrlHasher;
use Wallabag\UserBundle\Entity\User;
@ -40,7 +41,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
return 1;
}
} else {
$users = $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findAll();
$users = $this->getDoctrine()->getRepository(User::class)->findAll();
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
@ -57,7 +58,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
private function generateHashedUrls(User $user)
{
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
$repo = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry');
$repo = $this->getDoctrine()->getRepository(Entry::class);
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
@ -86,7 +87,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
*/
private function getUser($username)
{
return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
}
private function getDoctrine()

View file

@ -13,6 +13,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
use Wallabag\CoreBundle\Entity\RuleInterface;
@ -132,7 +133,7 @@ class ConfigController extends Controller
if ($request->query->has('tagging-rule')) {
$taggingRule = $this->getDoctrine()
->getRepository('WallabagCoreBundle:TaggingRule')
->getRepository(TaggingRule::class)
->find($request->query->get('tagging-rule'));
if ($this->getUser()->getId() !== $taggingRule->getConfig()->getUser()->getId()) {
@ -195,7 +196,7 @@ class ConfigController extends Controller
if ($request->query->has('ignore-origin-user-rule')) {
$ignoreOriginUserRule = $this->getDoctrine()
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
->getRepository(IgnoreOriginUserRule::class)
->find($request->query->get('ignore-origin-user-rule'));
if ($this->getUser()->getId() !== $ignoreOriginUserRule->getConfig()->getUser()->getId()) {
@ -548,7 +549,7 @@ class ConfigController extends Controller
switch ($type) {
case 'annotations':
$this->getDoctrine()
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->removeAllByUserId($this->getUser()->getId());
break;
case 'tags':
@ -558,7 +559,7 @@ class ConfigController extends Controller
// SQLite doesn't care about cascading remove, so we need to manually remove associated stuff
// otherwise they won't be removed ...
if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
$this->getDoctrine()->getRepository('WallabagAnnotationBundle:Annotation')->removeAllByUserId($this->getUser()->getId());
$this->getDoctrine()->getRepository(Annotation::class)->removeAllByUserId($this->getUser()->getId());
}
// manually remove tags to avoid orphan tag
@ -735,7 +736,7 @@ class ConfigController extends Controller
$em = $this->getDoctrine()->getManager();
$archivedEntriesAnnotations = $this->getDoctrine()
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findAllArchivedEntriesByUser($userId);
foreach ($archivedEntriesAnnotations as $archivedEntriesAnnotation) {
@ -764,7 +765,7 @@ class ConfigController extends Controller
private function getConfig()
{
$config = $this->getDoctrine()
->getRepository('WallabagCoreBundle:Config')
->getRepository(Config::class)
->findOneByUser($this->getUser());
// should NEVER HAPPEN ...

View file

@ -17,6 +17,7 @@ use Wallabag\ImportBundle\Import\PinboardImport;
use Wallabag\ImportBundle\Import\ReadabilityImport;
use Wallabag\ImportBundle\Import\WallabagV1Import;
use Wallabag\ImportBundle\Import\WallabagV2Import;
use Wallabag\UserBundle\Entity\User;
class ImportCommand extends ContainerAwareCommand
{
@ -47,9 +48,9 @@ class ImportCommand extends ContainerAwareCommand
$em->getConnection()->getConfiguration()->setSQLLogger(null);
if ($input->getOption('useUserId')) {
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneById($input->getArgument('username'));
$entityUser = $em->getRepository(User::class)->findOneById($input->getArgument('username'));
} else {
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneByUsername($input->getArgument('username'));
$entityUser = $em->getRepository(User::class)->findOneByUsername($input->getArgument('username'));
}
if (!\is_object($entityUser)) {

View file

@ -108,7 +108,7 @@ abstract class BrowserImport extends AbstractImport
$url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->user->getId());
if (false !== $existingEntry) {

View file

@ -98,7 +98,7 @@ class DeliciousImport extends AbstractImport
public function parseEntry(array $importedEntry)
{
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
if (false !== $existingEntry) {

View file

@ -126,7 +126,7 @@ class InstapaperImport extends AbstractImport
public function parseEntry(array $importedEntry)
{
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
if (false !== $existingEntry) {

View file

@ -98,7 +98,7 @@ class PinboardImport extends AbstractImport
public function parseEntry(array $importedEntry)
{
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($importedEntry['href'], $this->user->getId());
if (false !== $existingEntry) {

View file

@ -179,7 +179,7 @@ class PocketImport extends AbstractImport
$url = isset($importedEntry['resolved_url']) && '' !== $importedEntry['resolved_url'] ? $importedEntry['resolved_url'] : $importedEntry['given_url'];
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->user->getId());
if (false !== $existingEntry) {

View file

@ -98,7 +98,7 @@ class ReadabilityImport extends AbstractImport
public function parseEntry(array $importedEntry)
{
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($importedEntry['article__url'], $this->user->getId());
if (false !== $existingEntry) {

View file

@ -104,7 +104,7 @@ abstract class WallabagImport extends AbstractImport
public function parseEntry(array $importedEntry)
{
$existingEntry = $this->em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
if (false !== $existingEntry) {

View file

@ -139,7 +139,7 @@ class ManageController extends Controller
public function searchFormAction(Request $request, $page = 1)
{
$em = $this->getDoctrine()->getManager();
$qb = $em->getRepository('WallabagUserBundle:User')->createQueryBuilder('u');
$qb = $em->getRepository(User::class)->createQueryBuilder('u');
$form = $this->createForm(SearchUserType::class);
$form->handleRequest($request);
@ -147,7 +147,7 @@ class ManageController extends Controller
if ($form->isSubmitted() && $form->isValid()) {
$searchTerm = (isset($request->get('search_user')['term']) ? $request->get('search_user')['term'] : '');
$qb = $em->getRepository('WallabagUserBundle:User')->getQueryBuilderForSearch($searchTerm);
$qb = $em->getRepository(User::class)->getQueryBuilderForSearch($searchTerm);
}
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\AnnotationBundle\Controller;
use Tests\Wallabag\AnnotationBundle\WallabagAnnotationTestCase;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class AnnotationControllerTest extends WallabagAnnotationTestCase
{
@ -31,10 +32,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$annotation = new Annotation($user);
@ -57,7 +58,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->assertSame($annotation->getText(), $content['rows'][0]['text']);
// we need to re-fetch the annotation becase after the flush, it has been "detached" from the entity manager
$annotation = $em->getRepository('WallabagAnnotationBundle:Annotation')->findAnnotationById($annotation->getId());
$annotation = $em->getRepository(Annotation::class)->findAnnotationById($annotation->getId());
$em->remove($annotation);
$em->flush();
}
@ -77,7 +78,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Entry $entry */
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$headers = ['CONTENT_TYPE' => 'application/json'];
@ -101,7 +102,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Annotation $annotation */
$annotation = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findLastAnnotationByPageId($entry->getId(), 1);
$this->assertSame('my annotation', $annotation->getText());
@ -113,7 +114,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Entry $entry */
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$headers = ['CONTENT_TYPE' => 'application/json'];
@ -142,7 +143,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Entry $entry */
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$headers = ['CONTENT_TYPE' => 'application/json'];
@ -177,7 +178,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Entry $entry */
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$longQuote = str_repeat('a', 10001);
@ -204,10 +205,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$annotation = new Annotation($user);
@ -234,7 +235,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
/** @var Annotation $annotationUpdated */
$annotationUpdated = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findOneById($annotation->getId());
$this->assertSame('a modified annotation', $annotationUpdated->getText());
@ -252,10 +253,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$annotation = new Annotation($user);
@ -282,7 +283,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
$this->assertSame('This is my annotation /o/', $content['text']);
$annotationDeleted = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findOneById($annotation->getId());
$this->assertNull($annotationDeleted);

View file

@ -12,7 +12,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->logInAs('admin');
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
$nbClients = $em->getRepository(Client::class)->findAll();
$crawler = $client->request('GET', '/developer/client/create');
$this->assertSame(200, $client->getResponse()->getStatusCode());
@ -27,7 +27,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->assertSame(200, $client->getResponse()->getStatusCode());
$newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
$newNbClients = $em->getRepository(Client::class)->findAll();
$this->assertGreaterThan(\count($nbClients), \count($newNbClients));
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings table strong')->extract(['_text']));
@ -75,7 +75,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->logInAs('admin');
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$nbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
$nbClients = $em->getRepository(Client::class)->findAll();
$crawler = $client->request('GET', '/developer');
$this->assertSame(200, $client->getResponse()->getStatusCode());
@ -120,7 +120,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
$this->assertSame(302, $client->getResponse()->getStatusCode());
$this->assertNull(
$em->getRepository('WallabagApiBundle:Client')->find($adminApiClient->getId()),
$em->getRepository(Client::class)->find($adminApiClient->getId()),
'The client should have been removed'
);
}

View file

@ -14,7 +14,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
if (!$entry) {
@ -40,7 +40,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'url' => 'http://0.0.0.0/entry2']);
if (!$entry) {
@ -59,7 +59,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
if (!$entry) {
@ -107,7 +107,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId('bob'), 'isArchived' => false]);
if (!$entry) {
@ -205,7 +205,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -655,7 +655,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -697,7 +697,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -731,7 +731,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -762,7 +762,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -794,7 +794,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -816,7 +816,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneWithTags($this->user->getId());
$entry = $entry[0];
@ -839,7 +839,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUser($this->getUserId());
if (!$entry) {
@ -861,7 +861,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$entryDB = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$tagsInDB = [];
@ -878,7 +878,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneWithTags($this->user->getId());
$entry = $entry[0];
@ -904,7 +904,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
if (!$entry) {
@ -926,7 +926,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
if (!$entry) {
@ -948,7 +948,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
{
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
if (!$entry) {
@ -974,7 +974,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$now = new \DateTime();
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
if (!$entry) {
@ -1135,7 +1135,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testReloadEntryErrorWhileFetching()
{
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
if (!$entry) {
@ -1171,7 +1171,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
public function testPostEntriesTagsListAction()
{
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
$tags = $entry->getTags();
@ -1195,7 +1195,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->assertSame('http://0.0.0.0/entry4', $content[0]['url']);
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
$tags = $entry->getTags();
@ -1235,7 +1235,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
$this->client->request('DELETE', '/api/entries/tags/list?list=' . json_encode($list));
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
$entry = $em->getRepository('WallabagCoreBundle:Entry')->find($entry->getId());
$entry = $em->getRepository(Entry::class)->find($entry->getId());
$this->assertCount(0, $entry->getTags());
}

View file

@ -3,6 +3,7 @@
namespace Tests\Wallabag\ApiBundle\Controller;
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
class TagRestControllerTest extends WallabagApiTestCase
@ -35,7 +36,7 @@ class TagRestControllerTest extends WallabagApiTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneWithTags($this->user->getId());
$entry = $entry[0];
@ -61,12 +62,12 @@ class TagRestControllerTest extends WallabagApiTestCase
$this->assertSame($tag->getLabel(), $content['label']);
$this->assertSame($tag->getSlug(), $content['slug']);
$entries = $em->getRepository('WallabagCoreBundle:Entry')
$entries = $em->getRepository(Entry::class)
->findAllByTagId($this->user->getId(), $tag->getId());
$this->assertCount(0, $entries);
$tag = $em->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($tagLabel);
$tag = $em->getRepository(Tag::class)->findOneByLabel($tagLabel);
$this->assertNull($tag, $tagLabel . ' was removed because it begun an orphan tag');
}
@ -74,7 +75,7 @@ class TagRestControllerTest extends WallabagApiTestCase
public function testDeleteOtherUserTag()
{
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$tag = $em->getRepository('WallabagCoreBundle:Tag')->findOneByLabel($this->otherUserTagLabel);
$tag = $em->getRepository(Tag::class)->findOneByLabel($this->otherUserTagLabel);
$this->client->request('DELETE', '/api/tags/' . $tag->getId() . '.json');
@ -97,7 +98,7 @@ class TagRestControllerTest extends WallabagApiTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneWithTags($this->user->getId());
$entry = $entry[0];
@ -127,7 +128,7 @@ class TagRestControllerTest extends WallabagApiTestCase
$entries = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findAllByTagId($this->user->getId(), $tag->getId());
$this->assertCount(0, $entries);
@ -155,7 +156,7 @@ class TagRestControllerTest extends WallabagApiTestCase
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
$entry = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneWithTags($this->user->getId());
$entry = $entry[0];
@ -196,14 +197,14 @@ class TagRestControllerTest extends WallabagApiTestCase
$entries = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findAllByTagId($this->user->getId(), $tag->getId());
$this->assertCount(0, $entries);
$entries = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findAllByTagId($this->user->getId(), $tag2->getId());
$this->assertCount(0, $entries);

View file

@ -4,6 +4,7 @@ namespace Tests\Wallabag\ApiBundle;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Wallabag\UserBundle\Entity\User;
abstract class WallabagApiTestCase extends WebTestCase
{
@ -63,7 +64,7 @@ abstract class WallabagApiTestCase extends WebTestCase
return $this->client
->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName($username)
->getId();
}

View file

@ -7,6 +7,7 @@ use Symfony\Component\Console\Tester\CommandTester;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Command\CleanDuplicatesCommand;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class CleanDuplicatesCommandTest extends WallabagCoreTestCase
{
@ -66,10 +67,10 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
$this->logInAs('admin');
$nbEntries = $em->getRepository('WallabagCoreBundle:Entry')->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(0, $nbEntries);
$user = $em->getRepository('WallabagUserBundle:User')->findOneById($this->getLoggedInUserId());
$user = $em->getRepository(User::class)->findOneById($this->getLoggedInUserId());
$entry1 = new Entry($user);
$entry1->setUrl($url);
@ -82,7 +83,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
$em->flush();
$nbEntries = $em->getRepository('WallabagCoreBundle:Entry')->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(2, $nbEntries);
$application = new Application($this->getClient()->getKernel());
@ -98,7 +99,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
$this->assertStringContainsString('Cleaned 1 duplicates for user admin', $tester->getDisplay());
$nbEntries = $em->getRepository('WallabagCoreBundle:Entry')->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertCount(1, $nbEntries);
$query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');

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));

View file

@ -70,7 +70,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
$this->logInAs('admin');
/** @var User $user */
$user = $em->getRepository('WallabagUserBundle:User')->findOneById($this->getLoggedInUserId());
$user = $em->getRepository(User::class)->findOneById($this->getLoggedInUserId());
$user->setName('Bug boss');
$em->persist($user);

View file

@ -7,7 +7,9 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\Entity\Config;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Entity\TaggingRule;
use Wallabag\UserBundle\Entity\User;
class ConfigControllerTest extends WallabagCoreTestCase
@ -306,7 +308,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// reset the token
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
if (!$user) {
@ -570,7 +572,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:TaggingRule')
->getRepository(TaggingRule::class)
->findAll()[0];
$crawler = $client->request('GET', '/tagging-rule/delete/' . $rule->getId());
@ -586,7 +588,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:TaggingRule')
->getRepository(TaggingRule::class)
->findAll()[0];
$crawler = $client->request('GET', '/tagging-rule/edit/' . $rule->getId());
@ -707,7 +709,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
->getRepository(IgnoreOriginUserRule::class)
->findAll()[0];
$crawler = $client->request('GET', '/ignore-origin-user-rule/edit/' . $rule->getId());
@ -723,7 +725,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
->getRepository(IgnoreOriginUserRule::class)
->findAll()[0];
$crawler = $client->request('GET', '/ignore-origin-user-rule/edit/' . $rule->getId());
@ -776,13 +778,13 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('empty');
$user->setEnabled(false);
$em->persist($user);
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('bob');
$user->setEnabled(false);
$em->persist($user);
@ -798,13 +800,13 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertSame(403, $client->getResponse()->getStatusCode());
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('empty');
$user->setEnabled(true);
$em->persist($user);
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('bob');
$user->setEnabled(true);
$em->persist($user);
@ -867,7 +869,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->createQueryBuilder('u')
->where('u.username = :username')->setParameter('username', 'wallace')
->getQuery()
@ -878,7 +880,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$entries = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUser($loggedInUserId);
$this->assertEmpty($entries);
@ -931,7 +933,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.config.notice.annotations_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
$annotationsReset = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findAnnotationsByPageId($entry->getId(), $user->getId());
$this->assertEmpty($annotationsReset, 'Annotations were reset');
@ -947,7 +949,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.config.notice.tags_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
$tagReset = $em
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->countAllTags($user->getId());
$this->assertSame(0, $tagReset, 'Tags were reset');
@ -963,7 +965,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
$entryReset = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->countAllEntriesByUser($user->getId());
$this->assertSame(0, $entryReset, 'Entries were reset');
@ -1027,19 +1029,19 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.config.notice.archived_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
$entryReset = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->countAllEntriesByUser($user->getId());
$this->assertSame(1, $entryReset, 'Entries were reset');
$tagReset = $em
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->countAllTags($user->getId());
$this->assertSame(1, $tagReset, 'Tags were reset');
$annotationsReset = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findAnnotationsByPageId($annotationArchived->getId(), $user->getId());
$this->assertEmpty($annotationsReset, 'Annotations were reset');
@ -1084,19 +1086,19 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
$entryReset = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->countAllEntriesByUser($user->getId());
$this->assertSame(0, $entryReset, 'Entries were reset');
$tagReset = $em
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->countAllTags($user->getId());
$this->assertSame(0, $tagReset, 'Tags were reset');
$annotationsReset = $em
->getRepository('WallabagAnnotationBundle:Annotation')
->getRepository(Annotation::class)
->findAnnotationsByPageId($entry->getId(), $user->getId());
$this->assertEmpty($annotationsReset, 'Annotations were reset');
@ -1174,7 +1176,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// restore user
$em = $this->getEntityManager();
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertTrue($user->isEmailTwoFactor());
@ -1201,7 +1203,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// restore user
$em = $this->getEntityManager();
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertFalse($user->isEmailTwoFactor());
@ -1219,7 +1221,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// restore user
$em = $this->getEntityManager();
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertTrue($user->isGoogleTwoFactor());
@ -1243,7 +1245,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// restore user
$em = $this->getEntityManager();
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertTrue($user->isGoogleTwoFactor());
@ -1254,7 +1256,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
$this->assertSame(302, $client->getResponse()->getStatusCode());
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertFalse($user->isGoogleTwoFactor());
@ -1278,7 +1280,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
// restore user
$em = $this->getEntityManager();
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$this->assertEmpty($user->getGoogleAuthenticatorSecret());

View file

@ -10,6 +10,7 @@ use Wallabag\CoreBundle\Entity\SiteCredential;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\CoreBundle\Helper\ContentProxy;
use Wallabag\CoreBundle\Helper\CryptoProxy;
use Wallabag\UserBundle\Entity\User;
class EntryControllerTest extends WallabagCoreTestCase
{
@ -115,7 +116,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
$em->remove($entry);
$em->flush();
@ -165,7 +166,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
$author = $content->getPublishedBy();
@ -202,7 +203,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
$tags = $content->getTagsLabel();
@ -239,7 +240,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
@ -379,7 +380,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()
->get('doctrine.orm.entity_manager');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUrl($url);
$tags = $entry->getTagsLabel();
@ -408,7 +409,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('/', $client->getResponse()->getTargetUrl());
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUrl($url);
$tags = $entry->getTagsLabel();
@ -511,7 +512,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertSame(302, $client->getResponse()->getStatusCode());
$entry = $this->getEntityManager()
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$this->assertNotEmpty($entry->getContent());
@ -535,7 +536,7 @@ class EntryControllerTest extends WallabagCoreTestCase
// otherwise, retrieve the same entity will retrieve change from the previous request :0
$this->getEntityManager()->clear();
$newContent = $this->getEntityManager()
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$this->assertNotSame($client->getContainer()->getParameter('wallabag_core.fetching_error_message'), $newContent->getContent());
@ -645,7 +646,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$this->assertSame(1, $res->isArchived());
@ -668,7 +669,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneById($entry->getId());
$this->assertSame(1, $res->isStarred());
@ -710,7 +711,7 @@ class EntryControllerTest extends WallabagCoreTestCase
// add a new content to be removed later
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$content = new Entry($user);
@ -743,7 +744,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('bob');
$client->request('GET', '/view/' . $content->getId());
@ -949,7 +950,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$em = $this->getClient()->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$annotation = new Annotation($user);
@ -1210,7 +1211,7 @@ class EntryControllerTest extends WallabagCoreTestCase
->get('doctrine.orm.entity_manager');
$entry = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
@ -1250,7 +1251,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$client->request('GET', '/delete/' . $content->getId());
@ -1529,7 +1530,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
@ -1580,7 +1581,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertStringContainsString('flashes.entry.notice.entry_saved', $crawler->filter('body')->extract(['_text'])[0]);
$content = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
@ -1629,7 +1630,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId($url, $this->getLoggedInUserId());
$authors = $content->getPublishedBy();
@ -1643,7 +1644,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$entry = $em->getRepository('WallabagCoreBundle:Entry')->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
$entry = $em->getRepository(Entry::class)->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
$tag = $entry->getTags()[0];
$crawler = $client->request('GET', '/view/' . $entry->getId());
@ -1720,14 +1721,14 @@ class EntryControllerTest extends WallabagCoreTestCase
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry1->getId());
$this->assertSame(1, $res->isArchived());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry2->getId());
$this->assertSame(1, $res->isArchived());
@ -1742,14 +1743,14 @@ class EntryControllerTest extends WallabagCoreTestCase
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry1->getId());
$this->assertSame(1, $res->isStarred());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry2->getId());
$this->assertSame(1, $res->isStarred());
@ -1765,21 +1766,21 @@ class EntryControllerTest extends WallabagCoreTestCase
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry1->getId());
$this->assertContains('foo', $res->getTagsLabel());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry2->getId());
$this->assertContains('foo', $res->getTagsLabel());
$res = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry3->getId());
$this->assertNotContains('foo', $res->getTagsLabel());

View file

@ -50,7 +50,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
$client->request('GET', '/export/' . $content->getId() . '.doc');
@ -91,7 +91,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findOneByUsernameAndNotArchived('admin');
ob_start();
@ -159,7 +159,7 @@ class ExportControllerTest extends WallabagCoreTestCase
// to be sure results are the same
$contentInDB = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->createQueryBuilder('e')
->select('e, t')
->leftJoin('e.user', 'u')
@ -205,7 +205,7 @@ class ExportControllerTest extends WallabagCoreTestCase
$contentInDB = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
ob_start();
@ -279,7 +279,7 @@ class ExportControllerTest extends WallabagCoreTestCase
// to be sure results are the same
$contentInDB = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->createQueryBuilder('e')
->leftJoin('e.user', 'u')
->where('u.username = :username')->setParameter('username', 'admin')

View file

@ -3,6 +3,8 @@
namespace Tests\Wallabag\CoreBundle\Controller;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class FeedControllerTest extends WallabagCoreTestCase
{
@ -91,7 +93,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -112,7 +114,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -134,7 +136,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -156,7 +158,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -178,7 +180,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -206,7 +208,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$client = $this->getClient();
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$config = $user->getConfig();
@ -215,12 +217,12 @@ class FeedControllerTest extends WallabagCoreTestCase
$em->persist($config);
$entry1 = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find(1)
;
$entry4 = $em
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find(4)
;

View file

@ -3,6 +3,7 @@
namespace Tests\Wallabag\CoreBundle\Controller;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\UserBundle\Entity\User;
class SecurityControllerTest extends WallabagCoreTestCase
{
@ -40,7 +41,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$user->setEmailTwoFactor(true);
$em->persist($user);
@ -52,7 +53,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
// restore user
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$user->setEmailTwoFactor(false);
$em->persist($user);
@ -73,7 +74,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$user->setGoogleAuthenticatorSecret('26LDIHYGHNELOQEM');
$em->persist($user);
@ -85,7 +86,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
// restore user
$user = $em
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUsername('admin');
$user->setGoogleAuthenticatorSecret(null);
$em->persist($user);

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Controller;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
use Wallabag\UserBundle\Entity\User;
/**
* @group Tag
@ -77,7 +78,7 @@ class TagControllerTest extends WallabagCoreTestCase
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry2', $this->getLoggedInUserId());
$crawler = $client->request('GET', '/view/' . $entry->getId());
@ -93,7 +94,7 @@ class TagControllerTest extends WallabagCoreTestCase
$newEntry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$tags = $newEntry->getTags()->toArray();
@ -138,7 +139,7 @@ class TagControllerTest extends WallabagCoreTestCase
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findOneByLabel($this->tagName);
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
@ -170,23 +171,23 @@ class TagControllerTest extends WallabagCoreTestCase
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findOneByLabel($this->tagName);
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
$user = $this->getEntityManager()
->getRepository('WallabagUserBundle:User')
->getRepository(User::class)
->findOneByUserName('admin');
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/foo', $user->getId());
$entry2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/bar', $user->getId());
$this->assertEmpty($entry->getTagsLabel());
@ -205,7 +206,7 @@ class TagControllerTest extends WallabagCoreTestCase
$entry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
$tag->addEntry($entry);
@ -216,7 +217,7 @@ class TagControllerTest extends WallabagCoreTestCase
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findOneByEntryAndTagLabel($entry, $this->tagName);
$crawler = $client->request('GET', '/tag/list/' . $tag->getSlug());
@ -269,12 +270,12 @@ class TagControllerTest extends WallabagCoreTestCase
$freshEntry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$freshEntry2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry2->getId());
$tags = [];
@ -293,7 +294,7 @@ class TagControllerTest extends WallabagCoreTestCase
$newTag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($newTagLabel);
$this->assertCount(1, $newTag, 'New tag exists.');
@ -333,7 +334,7 @@ class TagControllerTest extends WallabagCoreTestCase
$freshEntry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$tags = [];
@ -347,7 +348,7 @@ class TagControllerTest extends WallabagCoreTestCase
$newTag = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($tagLabel);
$this->assertCount(1, $newTag);
@ -388,7 +389,7 @@ class TagControllerTest extends WallabagCoreTestCase
$freshEntry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$tags = [];
@ -402,12 +403,12 @@ class TagControllerTest extends WallabagCoreTestCase
$tagFromRepo = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($tagLabel);
$newTagFromRepo = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($newTagLabel);
$this->assertCount(0, $newTagFromRepo);
@ -458,22 +459,22 @@ class TagControllerTest extends WallabagCoreTestCase
$freshEntry1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry1->getId());
$freshEntry2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry2->getId());
$tagFromRepo = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($tagLabel);
$previousTagFromRepo = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Tag')
->getRepository(Tag::class)
->findByLabel($previousTagLabel);
$this->assertCount(1, $tagFromRepo);
@ -516,7 +517,7 @@ class TagControllerTest extends WallabagCoreTestCase
$newEntry = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->find($entry->getId());
$tags = $newEntry->getTags()->toArray();
@ -549,7 +550,7 @@ class TagControllerTest extends WallabagCoreTestCase
$entries = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread')
->getQuery()->getResult();

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class ChromeControllerTest extends WallabagCoreTestCase
{
@ -113,7 +114,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.20minutes.fr/sport/3256363-20220321-tournoi-vi-nations-trophee-gagne-xv-france-fini-fond-seine',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class DeliciousControllerTest extends WallabagCoreTestCase
{
@ -110,7 +111,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://feross.org/spoofmac/',
$this->getLoggedInUserId()
@ -152,7 +153,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
$content1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://stackoverflow.com/review/',
$this->getLoggedInUserId()
@ -162,7 +163,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
$content2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://addyosmani.com/basket.js/',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class ElcuratorControllerTest extends WallabagCoreTestCase
{
@ -114,7 +115,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://devblog.lexik.fr/git/qualite-de-code-integration-de-php-git-hooks-dans-symfony2-2842',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class FirefoxControllerTest extends WallabagCoreTestCase
{
@ -113,7 +114,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://lexpansion.lexpress.fr/high-tech/orange-offre-un-meilleur-reseau-mobile-que-bouygues-et-sfr-free-derriere_1811554.html',
$this->getLoggedInUserId()
@ -127,7 +128,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.lemonde.fr/disparitions/article/2018/07/05/le-journaliste-et-cineaste-claude-lanzmann-est-mort_5326313_3382.html',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class InstapaperControllerTest extends WallabagCoreTestCase
{
@ -113,7 +114,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.liberation.fr/societe/police-justice/cours-dassises-on-efface-le-peuple-dun-processus-judiciaire-dont-il-est-pourtant-le-coeur-battant-20210414_FYUNIZENHRGHZLAZEKSMKZYEPI/',
$this->getLoggedInUserId()
@ -130,7 +131,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe',
$this->getLoggedInUserId()
@ -165,7 +166,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$content1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://redditblog.com/2016/09/20/amp-and-reactredux/',
$this->getLoggedInUserId()
@ -175,7 +176,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
$content2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class PinboardControllerTest extends WallabagCoreTestCase
{
@ -110,7 +111,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://ma.ttias.be/varnish-explained/',
$this->getLoggedInUserId()
@ -157,7 +158,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$content1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://ilia.ws/files/nginx_torontophpug.pdf',
$this->getLoggedInUserId()
@ -168,7 +169,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
$content2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://developers.google.com/web/updates/2016/07/infinite-scroller',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class ReadabilityControllerTest extends WallabagCoreTestCase
{
@ -110,7 +111,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.20minutes.fr/bordeaux/2120479-20170823-bordeaux-poche-chocolatine-association-traduit-etudiants-etrangers-mots-sud-ouest',
$this->getLoggedInUserId()
@ -155,7 +156,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$content1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://blog.travis-ci.com/2016-07-28-what-we-learned-from-analyzing-2-million-travis-builds/',
$this->getLoggedInUserId()
@ -166,7 +167,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
$content2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://facebook.github.io/graphql/October2016/',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class WallabagV1ControllerTest extends WallabagCoreTestCase
{
@ -111,7 +112,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur',
$this->getLoggedInUserId()
@ -156,7 +157,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$content1 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'http://gilbert.pellegrom.me/recreating-the-square-slider',
$this->getLoggedInUserId()
@ -167,7 +168,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
$content2 = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.wallabag.org/features/',
$this->getLoggedInUserId()

View file

@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
use Predis\Client;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
class WallabagV2ControllerTest extends WallabagCoreTestCase
{
@ -114,7 +115,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867',
$this->getLoggedInUserId()
@ -133,7 +134,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
$content = $client->getContainer()
->get('doctrine.orm.entity_manager')
->getRepository('WallabagCoreBundle:Entry')
->getRepository(Entry::class)
->findByUrlAndUserId(
'https://www.mediapart.fr/',
$this->getLoggedInUserId()