mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 11:01:04 +00:00
Migrate getRepository with entities
This commit is contained in:
parent
50a941d8b4
commit
8b7b4975d6
38 changed files with 226 additions and 202 deletions
|
@ -24,7 +24,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||||
{
|
{
|
||||||
$annotationRows = $this
|
$annotationRows = $this
|
||||||
->getDoctrine()
|
->getDoctrine()
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
|
->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
|
||||||
$total = \count($annotationRows);
|
$total = \count($annotationRows);
|
||||||
$annotations = ['total' => $total, 'rows' => $annotationRows];
|
$annotations = ['total' => $total, 'rows' => $annotationRows];
|
||||||
|
|
|
@ -19,7 +19,7 @@ class DeveloperController extends Controller
|
||||||
*/
|
*/
|
||||||
public function indexAction()
|
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', [
|
return $this->render('@WallabagCore/themes/common/Developer/index.html.twig', [
|
||||||
'clients' => $clients,
|
'clients' => $clients,
|
||||||
|
|
|
@ -44,7 +44,7 @@ class EntryRestController extends WallabagRestController
|
||||||
public function getEntriesExistsAction(Request $request)
|
public function getEntriesExistsAction(Request $request)
|
||||||
{
|
{
|
||||||
$this->validateAuthentication();
|
$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');
|
$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);
|
$label = trim($label);
|
||||||
|
|
||||||
$tag = $this->getDoctrine()
|
$tag = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findOneByLabel($label);
|
->findOneByLabel($label);
|
||||||
|
|
||||||
if (false !== $tag) {
|
if (false !== $tag) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ class TagRestController extends WallabagRestController
|
||||||
$this->validateAuthentication();
|
$this->validateAuthentication();
|
||||||
|
|
||||||
$tags = $this->getDoctrine()
|
$tags = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findAllTags($this->getUser()->getId());
|
->findAllTags($this->getUser()->getId());
|
||||||
|
|
||||||
$json = $this->get('jms_serializer')->serialize($tags, 'json');
|
$json = $this->get('jms_serializer')->serialize($tags, 'json');
|
||||||
|
@ -46,7 +46,7 @@ class TagRestController extends WallabagRestController
|
||||||
$this->validateAuthentication();
|
$this->validateAuthentication();
|
||||||
$label = $request->get('tag', '');
|
$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)) {
|
if (empty($tags)) {
|
||||||
throw $this->createNotFoundException('Tag not found');
|
throw $this->createNotFoundException('Tag not found');
|
||||||
|
@ -55,7 +55,7 @@ class TagRestController extends WallabagRestController
|
||||||
$tag = $tags[0];
|
$tag = $tags[0];
|
||||||
|
|
||||||
$this->getDoctrine()
|
$this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->removeTag($this->getUser()->getId(), $tag);
|
->removeTag($this->getUser()->getId(), $tag);
|
||||||
|
|
||||||
$this->cleanOrphanTag($tag);
|
$this->cleanOrphanTag($tag);
|
||||||
|
@ -82,14 +82,14 @@ class TagRestController extends WallabagRestController
|
||||||
|
|
||||||
$tagsLabels = $request->get('tags', '');
|
$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)) {
|
if (empty($tags)) {
|
||||||
throw $this->createNotFoundException('Tags not found');
|
throw $this->createNotFoundException('Tags not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->getDoctrine()
|
$this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->removeTags($this->getUser()->getId(), $tags);
|
->removeTags($this->getUser()->getId(), $tags);
|
||||||
|
|
||||||
$this->cleanOrphanTag($tags);
|
$this->cleanOrphanTag($tags);
|
||||||
|
@ -114,14 +114,14 @@ class TagRestController extends WallabagRestController
|
||||||
{
|
{
|
||||||
$this->validateAuthentication();
|
$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)) {
|
if (empty($tagFromDb)) {
|
||||||
throw $this->createNotFoundException('Tag not found');
|
throw $this->createNotFoundException('Tag not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->getDoctrine()
|
$this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->removeTag($this->getUser()->getId(), $tag);
|
->removeTag($this->getUser()->getId(), $tag);
|
||||||
|
|
||||||
$this->cleanOrphanTag($tag);
|
$this->cleanOrphanTag($tag);
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Helper\UrlHasher;
|
use Wallabag\CoreBundle\Helper\UrlHasher;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
|
@ -40,7 +41,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
} 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)));
|
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
|
||||||
|
|
||||||
|
@ -57,7 +58,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||||
private function generateHashedUrls(User $user)
|
private function generateHashedUrls(User $user)
|
||||||
{
|
{
|
||||||
$em = $this->getContainer()->get('doctrine.orm.entity_manager');
|
$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());
|
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
|
||||||
|
|
||||||
|
@ -86,7 +87,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
||||||
*/
|
*/
|
||||||
private function getUser($username)
|
private function getUser($username)
|
||||||
{
|
{
|
||||||
return $this->getDoctrine()->getRepository('WallabagUserBundle:User')->findOneByUserName($username);
|
return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDoctrine()
|
private function getDoctrine()
|
||||||
|
|
|
@ -13,6 +13,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
||||||
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\CoreBundle\Entity\RuleInterface;
|
use Wallabag\CoreBundle\Entity\RuleInterface;
|
||||||
|
@ -132,7 +133,7 @@ class ConfigController extends Controller
|
||||||
|
|
||||||
if ($request->query->has('tagging-rule')) {
|
if ($request->query->has('tagging-rule')) {
|
||||||
$taggingRule = $this->getDoctrine()
|
$taggingRule = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:TaggingRule')
|
->getRepository(TaggingRule::class)
|
||||||
->find($request->query->get('tagging-rule'));
|
->find($request->query->get('tagging-rule'));
|
||||||
|
|
||||||
if ($this->getUser()->getId() !== $taggingRule->getConfig()->getUser()->getId()) {
|
if ($this->getUser()->getId() !== $taggingRule->getConfig()->getUser()->getId()) {
|
||||||
|
@ -195,7 +196,7 @@ class ConfigController extends Controller
|
||||||
|
|
||||||
if ($request->query->has('ignore-origin-user-rule')) {
|
if ($request->query->has('ignore-origin-user-rule')) {
|
||||||
$ignoreOriginUserRule = $this->getDoctrine()
|
$ignoreOriginUserRule = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
|
->getRepository(IgnoreOriginUserRule::class)
|
||||||
->find($request->query->get('ignore-origin-user-rule'));
|
->find($request->query->get('ignore-origin-user-rule'));
|
||||||
|
|
||||||
if ($this->getUser()->getId() !== $ignoreOriginUserRule->getConfig()->getUser()->getId()) {
|
if ($this->getUser()->getId() !== $ignoreOriginUserRule->getConfig()->getUser()->getId()) {
|
||||||
|
@ -548,7 +549,7 @@ class ConfigController extends Controller
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'annotations':
|
case 'annotations':
|
||||||
$this->getDoctrine()
|
$this->getDoctrine()
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->removeAllByUserId($this->getUser()->getId());
|
->removeAllByUserId($this->getUser()->getId());
|
||||||
break;
|
break;
|
||||||
case 'tags':
|
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
|
// SQLite doesn't care about cascading remove, so we need to manually remove associated stuff
|
||||||
// otherwise they won't be removed ...
|
// otherwise they won't be removed ...
|
||||||
if ($this->get('doctrine')->getConnection()->getDatabasePlatform() instanceof \Doctrine\DBAL\Platforms\SqlitePlatform) {
|
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
|
// manually remove tags to avoid orphan tag
|
||||||
|
@ -735,7 +736,7 @@ class ConfigController extends Controller
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
$archivedEntriesAnnotations = $this->getDoctrine()
|
$archivedEntriesAnnotations = $this->getDoctrine()
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findAllArchivedEntriesByUser($userId);
|
->findAllArchivedEntriesByUser($userId);
|
||||||
|
|
||||||
foreach ($archivedEntriesAnnotations as $archivedEntriesAnnotation) {
|
foreach ($archivedEntriesAnnotations as $archivedEntriesAnnotation) {
|
||||||
|
@ -764,7 +765,7 @@ class ConfigController extends Controller
|
||||||
private function getConfig()
|
private function getConfig()
|
||||||
{
|
{
|
||||||
$config = $this->getDoctrine()
|
$config = $this->getDoctrine()
|
||||||
->getRepository('WallabagCoreBundle:Config')
|
->getRepository(Config::class)
|
||||||
->findOneByUser($this->getUser());
|
->findOneByUser($this->getUser());
|
||||||
|
|
||||||
// should NEVER HAPPEN ...
|
// should NEVER HAPPEN ...
|
||||||
|
|
|
@ -17,6 +17,7 @@ use Wallabag\ImportBundle\Import\PinboardImport;
|
||||||
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
||||||
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
||||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class ImportCommand extends ContainerAwareCommand
|
class ImportCommand extends ContainerAwareCommand
|
||||||
{
|
{
|
||||||
|
@ -47,9 +48,9 @@ class ImportCommand extends ContainerAwareCommand
|
||||||
$em->getConnection()->getConfiguration()->setSQLLogger(null);
|
$em->getConnection()->getConfiguration()->setSQLLogger(null);
|
||||||
|
|
||||||
if ($input->getOption('useUserId')) {
|
if ($input->getOption('useUserId')) {
|
||||||
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneById($input->getArgument('username'));
|
$entityUser = $em->getRepository(User::class)->findOneById($input->getArgument('username'));
|
||||||
} else {
|
} else {
|
||||||
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneByUsername($input->getArgument('username'));
|
$entityUser = $em->getRepository(User::class)->findOneByUsername($input->getArgument('username'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!\is_object($entityUser)) {
|
if (!\is_object($entityUser)) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ abstract class BrowserImport extends AbstractImport
|
||||||
$url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
|
$url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
|
||||||
|
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->user->getId());
|
->findByUrlAndUserId($url, $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ class DeliciousImport extends AbstractImport
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -126,7 +126,7 @@ class InstapaperImport extends AbstractImport
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ class PinboardImport extends AbstractImport
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($importedEntry['href'], $this->user->getId());
|
->findByUrlAndUserId($importedEntry['href'], $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -179,7 +179,7 @@ class PocketImport extends AbstractImport
|
||||||
$url = isset($importedEntry['resolved_url']) && '' !== $importedEntry['resolved_url'] ? $importedEntry['resolved_url'] : $importedEntry['given_url'];
|
$url = isset($importedEntry['resolved_url']) && '' !== $importedEntry['resolved_url'] ? $importedEntry['resolved_url'] : $importedEntry['given_url'];
|
||||||
|
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->user->getId());
|
->findByUrlAndUserId($url, $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -98,7 +98,7 @@ class ReadabilityImport extends AbstractImport
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($importedEntry['article__url'], $this->user->getId());
|
->findByUrlAndUserId($importedEntry['article__url'], $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -104,7 +104,7 @@ abstract class WallabagImport extends AbstractImport
|
||||||
public function parseEntry(array $importedEntry)
|
public function parseEntry(array $importedEntry)
|
||||||
{
|
{
|
||||||
$existingEntry = $this->em
|
$existingEntry = $this->em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||||
|
|
||||||
if (false !== $existingEntry) {
|
if (false !== $existingEntry) {
|
||||||
|
|
|
@ -139,7 +139,7 @@ class ManageController extends Controller
|
||||||
public function searchFormAction(Request $request, $page = 1)
|
public function searchFormAction(Request $request, $page = 1)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$qb = $em->getRepository('WallabagUserBundle:User')->createQueryBuilder('u');
|
$qb = $em->getRepository(User::class)->createQueryBuilder('u');
|
||||||
|
|
||||||
$form = $this->createForm(SearchUserType::class);
|
$form = $this->createForm(SearchUserType::class);
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
@ -147,7 +147,7 @@ class ManageController extends Controller
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$searchTerm = (isset($request->get('search_user')['term']) ? $request->get('search_user')['term'] : '');
|
$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);
|
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\AnnotationBundle\Controller;
|
||||||
use Tests\Wallabag\AnnotationBundle\WallabagAnnotationTestCase;
|
use Tests\Wallabag\AnnotationBundle\WallabagAnnotationTestCase;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class AnnotationControllerTest extends WallabagAnnotationTestCase
|
class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
{
|
{
|
||||||
|
@ -31,10 +32,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$annotation = new Annotation($user);
|
$annotation = new Annotation($user);
|
||||||
|
@ -57,7 +58,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
$this->assertSame($annotation->getText(), $content['rows'][0]['text']);
|
$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
|
// 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->remove($annotation);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
}
|
}
|
||||||
|
@ -77,7 +78,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Entry $entry */
|
/** @var Entry $entry */
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||||
|
@ -101,7 +102,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Annotation $annotation */
|
/** @var Annotation $annotation */
|
||||||
$annotation = $em
|
$annotation = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findLastAnnotationByPageId($entry->getId(), 1);
|
->findLastAnnotationByPageId($entry->getId(), 1);
|
||||||
|
|
||||||
$this->assertSame('my annotation', $annotation->getText());
|
$this->assertSame('my annotation', $annotation->getText());
|
||||||
|
@ -113,7 +114,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Entry $entry */
|
/** @var Entry $entry */
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||||
|
@ -142,7 +143,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Entry $entry */
|
/** @var Entry $entry */
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$headers = ['CONTENT_TYPE' => 'application/json'];
|
$headers = ['CONTENT_TYPE' => 'application/json'];
|
||||||
|
@ -177,7 +178,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Entry $entry */
|
/** @var Entry $entry */
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$longQuote = str_repeat('a', 10001);
|
$longQuote = str_repeat('a', 10001);
|
||||||
|
@ -204,10 +205,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$annotation = new Annotation($user);
|
$annotation = new Annotation($user);
|
||||||
|
@ -234,7 +235,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
|
|
||||||
/** @var Annotation $annotationUpdated */
|
/** @var Annotation $annotationUpdated */
|
||||||
$annotationUpdated = $em
|
$annotationUpdated = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findOneById($annotation->getId());
|
->findOneById($annotation->getId());
|
||||||
$this->assertSame('a modified annotation', $annotationUpdated->getText());
|
$this->assertSame('a modified annotation', $annotationUpdated->getText());
|
||||||
|
|
||||||
|
@ -252,10 +253,10 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$annotation = new Annotation($user);
|
$annotation = new Annotation($user);
|
||||||
|
@ -282,7 +283,7 @@ class AnnotationControllerTest extends WallabagAnnotationTestCase
|
||||||
$this->assertSame('This is my annotation /o/', $content['text']);
|
$this->assertSame('This is my annotation /o/', $content['text']);
|
||||||
|
|
||||||
$annotationDeleted = $em
|
$annotationDeleted = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findOneById($annotation->getId());
|
->findOneById($annotation->getId());
|
||||||
|
|
||||||
$this->assertNull($annotationDeleted);
|
$this->assertNull($annotationDeleted);
|
||||||
|
|
|
@ -12,7 +12,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$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');
|
$crawler = $client->request('GET', '/developer/client/create');
|
||||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
@ -27,7 +27,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
$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(\count($nbClients), \count($newNbClients));
|
||||||
|
|
||||||
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings table strong')->extract(['_text']));
|
$this->assertGreaterThan(1, $alert = $crawler->filter('.settings table strong')->extract(['_text']));
|
||||||
|
@ -75,7 +75,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$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');
|
$crawler = $client->request('GET', '/developer');
|
||||||
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
$this->assertSame(200, $client->getResponse()->getStatusCode());
|
||||||
|
@ -120,7 +120,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$this->assertNull(
|
$this->assertNull(
|
||||||
$em->getRepository('WallabagApiBundle:Client')->find($adminApiClient->getId()),
|
$em->getRepository(Client::class)->find($adminApiClient->getId()),
|
||||||
'The client should have been removed'
|
'The client should have been removed'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
|
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -40,7 +40,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'url' => 'http://0.0.0.0/entry2']);
|
->findOneBy(['user' => $this->getUserId(), 'url' => 'http://0.0.0.0/entry2']);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -59,7 +59,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
|
->findOneBy(['user' => $this->getUserId(), 'isArchived' => false]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -107,7 +107,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId('bob'), 'isArchived' => false]);
|
->findOneBy(['user' => $this->getUserId('bob'), 'isArchived' => false]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -205,7 +205,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -655,7 +655,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -697,7 +697,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -731,7 +731,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -762,7 +762,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -794,7 +794,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -816,7 +816,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneWithTags($this->user->getId());
|
->findOneWithTags($this->user->getId());
|
||||||
|
|
||||||
$entry = $entry[0];
|
$entry = $entry[0];
|
||||||
|
@ -839,7 +839,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUser($this->getUserId());
|
->findOneByUser($this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -861,7 +861,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
|
|
||||||
$entryDB = $this->client->getContainer()
|
$entryDB = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$tagsInDB = [];
|
$tagsInDB = [];
|
||||||
|
@ -878,7 +878,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneWithTags($this->user->getId());
|
->findOneWithTags($this->user->getId());
|
||||||
$entry = $entry[0];
|
$entry = $entry[0];
|
||||||
|
|
||||||
|
@ -904,7 +904,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
|
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -926,7 +926,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
|
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -948,7 +948,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
|
->findOneBy(['user' => $this->getUserId(), 'isArchived' => true]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -974,7 +974,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
$now = new \DateTime();
|
$now = new \DateTime();
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
|
->findOneBy(['user' => $this->getUserId(), 'isStarred' => true]);
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -1135,7 +1135,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
public function testReloadEntryErrorWhileFetching()
|
public function testReloadEntryErrorWhileFetching()
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
||||||
|
|
||||||
if (!$entry) {
|
if (!$entry) {
|
||||||
|
@ -1171,7 +1171,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
public function testPostEntriesTagsListAction()
|
public function testPostEntriesTagsListAction()
|
||||||
{
|
{
|
||||||
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
||||||
|
|
||||||
$tags = $entry->getTags();
|
$tags = $entry->getTags();
|
||||||
|
@ -1195,7 +1195,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
$this->assertSame('http://0.0.0.0/entry4', $content[0]['url']);
|
$this->assertSame('http://0.0.0.0/entry4', $content[0]['url']);
|
||||||
|
|
||||||
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
$entry = $this->client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getUserId());
|
||||||
|
|
||||||
$tags = $entry->getTags();
|
$tags = $entry->getTags();
|
||||||
|
@ -1235,7 +1235,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
|
||||||
$this->client->request('DELETE', '/api/entries/tags/list?list=' . json_encode($list));
|
$this->client->request('DELETE', '/api/entries/tags/list?list=' . json_encode($list));
|
||||||
$this->assertSame(200, $this->client->getResponse()->getStatusCode());
|
$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());
|
$this->assertCount(0, $entry->getTags());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace Tests\Wallabag\ApiBundle\Controller;
|
namespace Tests\Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
|
use Tests\Wallabag\ApiBundle\WallabagApiTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
|
|
||||||
class TagRestControllerTest extends WallabagApiTestCase
|
class TagRestControllerTest extends WallabagApiTestCase
|
||||||
|
@ -35,7 +36,7 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneWithTags($this->user->getId());
|
->findOneWithTags($this->user->getId());
|
||||||
|
|
||||||
$entry = $entry[0];
|
$entry = $entry[0];
|
||||||
|
@ -61,12 +62,12 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
$this->assertSame($tag->getLabel(), $content['label']);
|
$this->assertSame($tag->getLabel(), $content['label']);
|
||||||
$this->assertSame($tag->getSlug(), $content['slug']);
|
$this->assertSame($tag->getSlug(), $content['slug']);
|
||||||
|
|
||||||
$entries = $em->getRepository('WallabagCoreBundle:Entry')
|
$entries = $em->getRepository(Entry::class)
|
||||||
->findAllByTagId($this->user->getId(), $tag->getId());
|
->findAllByTagId($this->user->getId(), $tag->getId());
|
||||||
|
|
||||||
$this->assertCount(0, $entries);
|
$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');
|
$this->assertNull($tag, $tagLabel . ' was removed because it begun an orphan tag');
|
||||||
}
|
}
|
||||||
|
@ -74,7 +75,7 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
public function testDeleteOtherUserTag()
|
public function testDeleteOtherUserTag()
|
||||||
{
|
{
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$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');
|
$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');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneWithTags($this->user->getId());
|
->findOneWithTags($this->user->getId());
|
||||||
|
|
||||||
$entry = $entry[0];
|
$entry = $entry[0];
|
||||||
|
@ -127,7 +128,7 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
|
|
||||||
$entries = $this->client->getContainer()
|
$entries = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findAllByTagId($this->user->getId(), $tag->getId());
|
->findAllByTagId($this->user->getId(), $tag->getId());
|
||||||
|
|
||||||
$this->assertCount(0, $entries);
|
$this->assertCount(0, $entries);
|
||||||
|
@ -155,7 +156,7 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$entry = $this->client->getContainer()
|
$entry = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneWithTags($this->user->getId());
|
->findOneWithTags($this->user->getId());
|
||||||
|
|
||||||
$entry = $entry[0];
|
$entry = $entry[0];
|
||||||
|
@ -196,14 +197,14 @@ class TagRestControllerTest extends WallabagApiTestCase
|
||||||
|
|
||||||
$entries = $this->client->getContainer()
|
$entries = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findAllByTagId($this->user->getId(), $tag->getId());
|
->findAllByTagId($this->user->getId(), $tag->getId());
|
||||||
|
|
||||||
$this->assertCount(0, $entries);
|
$this->assertCount(0, $entries);
|
||||||
|
|
||||||
$entries = $this->client->getContainer()
|
$entries = $this->client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findAllByTagId($this->user->getId(), $tag2->getId());
|
->findAllByTagId($this->user->getId(), $tag2->getId());
|
||||||
|
|
||||||
$this->assertCount(0, $entries);
|
$this->assertCount(0, $entries);
|
||||||
|
|
|
@ -4,6 +4,7 @@ namespace Tests\Wallabag\ApiBundle;
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||||
use Symfony\Component\BrowserKit\Cookie;
|
use Symfony\Component\BrowserKit\Cookie;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
abstract class WallabagApiTestCase extends WebTestCase
|
abstract class WallabagApiTestCase extends WebTestCase
|
||||||
{
|
{
|
||||||
|
@ -63,7 +64,7 @@ abstract class WallabagApiTestCase extends WebTestCase
|
||||||
return $this->client
|
return $this->client
|
||||||
->getContainer()
|
->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName($username)
|
->findOneByUserName($username)
|
||||||
->getId();
|
->getId();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
use Wallabag\CoreBundle\Command\CleanDuplicatesCommand;
|
use Wallabag\CoreBundle\Command\CleanDuplicatesCommand;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class CleanDuplicatesCommandTest extends WallabagCoreTestCase
|
class CleanDuplicatesCommandTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -66,10 +67,10 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->logInAs('admin');
|
$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);
|
$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 = new Entry($user);
|
||||||
$entry1->setUrl($url);
|
$entry1->setUrl($url);
|
||||||
|
@ -82,7 +83,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$nbEntries = $em->getRepository('WallabagCoreBundle:Entry')->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
|
$nbEntries = $em->getRepository(Entry::class)->findAllByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
$this->assertCount(2, $nbEntries);
|
$this->assertCount(2, $nbEntries);
|
||||||
|
|
||||||
$application = new Application($this->getClient()->getKernel());
|
$application = new Application($this->getClient()->getKernel());
|
||||||
|
@ -98,7 +99,7 @@ class CleanDuplicatesCommandTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->assertStringContainsString('Cleaned 1 duplicates for user admin', $tester->getDisplay());
|
$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);
|
$this->assertCount(1, $nbEntries);
|
||||||
|
|
||||||
$query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
|
$query = $em->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\Entry e WHERE e.url = :url');
|
||||||
|
|
|
@ -7,6 +7,7 @@ use Symfony\Component\Console\Tester\CommandTester;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
use Wallabag\CoreBundle\Command\GenerateUrlHashesCommand;
|
use Wallabag\CoreBundle\Command\GenerateUrlHashesCommand;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -66,7 +67,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
|
|
||||||
$user = $em->getRepository('WallabagUserBundle:User')->findOneById($this->getLoggedInUserId());
|
$user = $em->getRepository(User::class)->findOneById($this->getLoggedInUserId());
|
||||||
|
|
||||||
$entry1 = new Entry($user);
|
$entry1 = new Entry($user);
|
||||||
$entry1->setUrl($url);
|
$entry1->setUrl($url);
|
||||||
|
@ -87,7 +88,7 @@ class GenerateUrlHashesCommandTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$this->assertStringContainsString('Generated hashed urls for user: admin', $tester->getDisplay());
|
$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));
|
$this->assertSame($entry->getHashedUrl(), hash('sha1', $url));
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class ShowUserCommandTest extends WallabagCoreTestCase
|
||||||
$this->logInAs('admin');
|
$this->logInAs('admin');
|
||||||
|
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user = $em->getRepository('WallabagUserBundle:User')->findOneById($this->getLoggedInUserId());
|
$user = $em->getRepository(User::class)->findOneById($this->getLoggedInUserId());
|
||||||
|
|
||||||
$user->setName('Bug boss');
|
$user->setName('Bug boss');
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
|
|
@ -7,7 +7,9 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||||
use Wallabag\CoreBundle\Entity\Config;
|
use Wallabag\CoreBundle\Entity\Config;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
|
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||||
use Wallabag\UserBundle\Entity\User;
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class ConfigControllerTest extends WallabagCoreTestCase
|
class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
|
@ -306,7 +308,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// reset the token
|
// reset the token
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
|
@ -570,7 +572,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:TaggingRule')
|
->getRepository(TaggingRule::class)
|
||||||
->findAll()[0];
|
->findAll()[0];
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/tagging-rule/delete/' . $rule->getId());
|
$crawler = $client->request('GET', '/tagging-rule/delete/' . $rule->getId());
|
||||||
|
@ -586,7 +588,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:TaggingRule')
|
->getRepository(TaggingRule::class)
|
||||||
->findAll()[0];
|
->findAll()[0];
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/tagging-rule/edit/' . $rule->getId());
|
$crawler = $client->request('GET', '/tagging-rule/edit/' . $rule->getId());
|
||||||
|
@ -707,7 +709,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
|
->getRepository(IgnoreOriginUserRule::class)
|
||||||
->findAll()[0];
|
->findAll()[0];
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/ignore-origin-user-rule/edit/' . $rule->getId());
|
$crawler = $client->request('GET', '/ignore-origin-user-rule/edit/' . $rule->getId());
|
||||||
|
@ -723,7 +725,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
$rule = $client->getContainer()->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:IgnoreOriginUserRule')
|
->getRepository(IgnoreOriginUserRule::class)
|
||||||
->findAll()[0];
|
->findAll()[0];
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/ignore-origin-user-rule/edit/' . $rule->getId());
|
$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');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('empty');
|
->findOneByUsername('empty');
|
||||||
$user->setEnabled(false);
|
$user->setEnabled(false);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('bob');
|
->findOneByUsername('bob');
|
||||||
$user->setEnabled(false);
|
$user->setEnabled(false);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -798,13 +800,13 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertSame(403, $client->getResponse()->getStatusCode());
|
$this->assertSame(403, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('empty');
|
->findOneByUsername('empty');
|
||||||
$user->setEnabled(true);
|
$user->setEnabled(true);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('bob');
|
->findOneByUsername('bob');
|
||||||
$user->setEnabled(true);
|
$user->setEnabled(true);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -867,7 +869,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->createQueryBuilder('u')
|
->createQueryBuilder('u')
|
||||||
->where('u.username = :username')->setParameter('username', 'wallace')
|
->where('u.username = :username')->setParameter('username', 'wallace')
|
||||||
->getQuery()
|
->getQuery()
|
||||||
|
@ -878,7 +880,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$entries = $client->getContainer()
|
$entries = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUser($loggedInUserId);
|
->findByUser($loggedInUserId);
|
||||||
|
|
||||||
$this->assertEmpty($entries);
|
$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]);
|
$this->assertStringContainsString('flashes.config.notice.annotations_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
|
||||||
|
|
||||||
$annotationsReset = $em
|
$annotationsReset = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findAnnotationsByPageId($entry->getId(), $user->getId());
|
->findAnnotationsByPageId($entry->getId(), $user->getId());
|
||||||
|
|
||||||
$this->assertEmpty($annotationsReset, 'Annotations were reset');
|
$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]);
|
$this->assertStringContainsString('flashes.config.notice.tags_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
|
||||||
|
|
||||||
$tagReset = $em
|
$tagReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->countAllTags($user->getId());
|
->countAllTags($user->getId());
|
||||||
|
|
||||||
$this->assertSame(0, $tagReset, 'Tags were reset');
|
$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]);
|
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
|
||||||
|
|
||||||
$entryReset = $em
|
$entryReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->countAllEntriesByUser($user->getId());
|
->countAllEntriesByUser($user->getId());
|
||||||
|
|
||||||
$this->assertSame(0, $entryReset, 'Entries were reset');
|
$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]);
|
$this->assertStringContainsString('flashes.config.notice.archived_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
|
||||||
|
|
||||||
$entryReset = $em
|
$entryReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->countAllEntriesByUser($user->getId());
|
->countAllEntriesByUser($user->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $entryReset, 'Entries were reset');
|
$this->assertSame(1, $entryReset, 'Entries were reset');
|
||||||
|
|
||||||
$tagReset = $em
|
$tagReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->countAllTags($user->getId());
|
->countAllTags($user->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $tagReset, 'Tags were reset');
|
$this->assertSame(1, $tagReset, 'Tags were reset');
|
||||||
|
|
||||||
$annotationsReset = $em
|
$annotationsReset = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findAnnotationsByPageId($annotationArchived->getId(), $user->getId());
|
->findAnnotationsByPageId($annotationArchived->getId(), $user->getId());
|
||||||
|
|
||||||
$this->assertEmpty($annotationsReset, 'Annotations were reset');
|
$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]);
|
$this->assertStringContainsString('flashes.config.notice.entries_reset', $client->getContainer()->get('session')->getFlashBag()->get('notice')[0]);
|
||||||
|
|
||||||
$entryReset = $em
|
$entryReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->countAllEntriesByUser($user->getId());
|
->countAllEntriesByUser($user->getId());
|
||||||
|
|
||||||
$this->assertSame(0, $entryReset, 'Entries were reset');
|
$this->assertSame(0, $entryReset, 'Entries were reset');
|
||||||
|
|
||||||
$tagReset = $em
|
$tagReset = $em
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->countAllTags($user->getId());
|
->countAllTags($user->getId());
|
||||||
|
|
||||||
$this->assertSame(0, $tagReset, 'Tags were reset');
|
$this->assertSame(0, $tagReset, 'Tags were reset');
|
||||||
|
|
||||||
$annotationsReset = $em
|
$annotationsReset = $em
|
||||||
->getRepository('WallabagAnnotationBundle:Annotation')
|
->getRepository(Annotation::class)
|
||||||
->findAnnotationsByPageId($entry->getId(), $user->getId());
|
->findAnnotationsByPageId($entry->getId(), $user->getId());
|
||||||
|
|
||||||
$this->assertEmpty($annotationsReset, 'Annotations were reset');
|
$this->assertEmpty($annotationsReset, 'Annotations were reset');
|
||||||
|
@ -1174,7 +1176,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// restore user
|
// restore user
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertTrue($user->isEmailTwoFactor());
|
$this->assertTrue($user->isEmailTwoFactor());
|
||||||
|
@ -1201,7 +1203,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// restore user
|
// restore user
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertFalse($user->isEmailTwoFactor());
|
$this->assertFalse($user->isEmailTwoFactor());
|
||||||
|
@ -1219,7 +1221,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// restore user
|
// restore user
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertTrue($user->isGoogleTwoFactor());
|
$this->assertTrue($user->isGoogleTwoFactor());
|
||||||
|
@ -1243,7 +1245,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// restore user
|
// restore user
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertTrue($user->isGoogleTwoFactor());
|
$this->assertTrue($user->isGoogleTwoFactor());
|
||||||
|
@ -1254,7 +1256,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertFalse($user->isGoogleTwoFactor());
|
$this->assertFalse($user->isGoogleTwoFactor());
|
||||||
|
@ -1278,7 +1280,7 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
||||||
// restore user
|
// restore user
|
||||||
$em = $this->getEntityManager();
|
$em = $this->getEntityManager();
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$this->assertEmpty($user->getGoogleAuthenticatorSecret());
|
$this->assertEmpty($user->getGoogleAuthenticatorSecret());
|
||||||
|
|
|
@ -10,6 +10,7 @@ use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class EntryControllerTest extends WallabagCoreTestCase
|
class EntryControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -115,7 +116,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$em = $client->getContainer()
|
$em = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
||||||
$em->remove($entry);
|
$em->remove($entry);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
@ -165,7 +166,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$author = $content->getPublishedBy();
|
$author = $content->getPublishedBy();
|
||||||
|
@ -202,7 +203,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($this->url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$tags = $content->getTagsLabel();
|
$tags = $content->getTagsLabel();
|
||||||
|
@ -239,7 +240,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
|
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
|
||||||
|
@ -379,7 +380,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$em = $client->getContainer()
|
$em = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUrl($url);
|
->findOneByUrl($url);
|
||||||
$tags = $entry->getTagsLabel();
|
$tags = $entry->getTagsLabel();
|
||||||
|
|
||||||
|
@ -408,7 +409,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertStringContainsString('/', $client->getResponse()->getTargetUrl());
|
$this->assertStringContainsString('/', $client->getResponse()->getTargetUrl());
|
||||||
|
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUrl($url);
|
->findOneByUrl($url);
|
||||||
|
|
||||||
$tags = $entry->getTagsLabel();
|
$tags = $entry->getTagsLabel();
|
||||||
|
@ -511,7 +512,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
$this->assertSame(302, $client->getResponse()->getStatusCode());
|
||||||
|
|
||||||
$entry = $this->getEntityManager()
|
$entry = $this->getEntityManager()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$this->assertNotEmpty($entry->getContent());
|
$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
|
// otherwise, retrieve the same entity will retrieve change from the previous request :0
|
||||||
$this->getEntityManager()->clear();
|
$this->getEntityManager()->clear();
|
||||||
$newContent = $this->getEntityManager()
|
$newContent = $this->getEntityManager()
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$this->assertNotSame($client->getContainer()->getParameter('wallabag_core.fetching_error_message'), $newContent->getContent());
|
$this->assertNotSame($client->getContainer()->getParameter('wallabag_core.fetching_error_message'), $newContent->getContent());
|
||||||
|
@ -645,7 +646,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isArchived());
|
$this->assertSame(1, $res->isArchived());
|
||||||
|
@ -668,7 +669,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneById($entry->getId());
|
->findOneById($entry->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isStarred());
|
$this->assertSame(1, $res->isStarred());
|
||||||
|
@ -710,7 +711,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
// add a new content to be removed later
|
// add a new content to be removed later
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
|
|
||||||
$content = new Entry($user);
|
$content = new Entry($user);
|
||||||
|
@ -743,7 +744,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('bob');
|
->findOneByUsernameAndNotArchived('bob');
|
||||||
|
|
||||||
$client->request('GET', '/view/' . $content->getId());
|
$client->request('GET', '/view/' . $content->getId());
|
||||||
|
@ -949,7 +950,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$em = $this->getClient()->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $this->getClient()->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
|
|
||||||
$annotation = new Annotation($user);
|
$annotation = new Annotation($user);
|
||||||
|
@ -1210,7 +1211,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
->get('doctrine.orm.entity_manager');
|
->get('doctrine.orm.entity_manager');
|
||||||
|
|
||||||
$entry = $em
|
$entry = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
|
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry);
|
||||||
|
@ -1250,7 +1251,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$client->request('GET', '/delete/' . $content->getId());
|
$client->request('GET', '/delete/' . $content->getId());
|
||||||
|
@ -1529,7 +1530,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
|
$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]);
|
$this->assertStringContainsString('flashes.entry.notice.entry_saved', $crawler->filter('body')->extract(['_text'])[0]);
|
||||||
|
|
||||||
$content = $em
|
$content = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
|
$this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content);
|
||||||
|
@ -1629,7 +1630,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
->findByUrlAndUserId($url, $this->getLoggedInUserId());
|
||||||
|
|
||||||
$authors = $content->getPublishedBy();
|
$authors = $content->getPublishedBy();
|
||||||
|
@ -1643,7 +1644,7 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
|
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$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];
|
$tag = $entry->getTags()[0];
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/view/' . $entry->getId());
|
$crawler = $client->request('GET', '/view/' . $entry->getId());
|
||||||
|
@ -1720,14 +1721,14 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry1->getId());
|
->find($entry1->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isArchived());
|
$this->assertSame(1, $res->isArchived());
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry2->getId());
|
->find($entry2->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isArchived());
|
$this->assertSame(1, $res->isArchived());
|
||||||
|
@ -1742,14 +1743,14 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry1->getId());
|
->find($entry1->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isStarred());
|
$this->assertSame(1, $res->isStarred());
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry2->getId());
|
->find($entry2->getId());
|
||||||
|
|
||||||
$this->assertSame(1, $res->isStarred());
|
$this->assertSame(1, $res->isStarred());
|
||||||
|
@ -1765,21 +1766,21 @@ class EntryControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry1->getId());
|
->find($entry1->getId());
|
||||||
|
|
||||||
$this->assertContains('foo', $res->getTagsLabel());
|
$this->assertContains('foo', $res->getTagsLabel());
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry2->getId());
|
->find($entry2->getId());
|
||||||
|
|
||||||
$this->assertContains('foo', $res->getTagsLabel());
|
$this->assertContains('foo', $res->getTagsLabel());
|
||||||
|
|
||||||
$res = $client->getContainer()
|
$res = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry3->getId());
|
->find($entry3->getId());
|
||||||
|
|
||||||
$this->assertNotContains('foo', $res->getTagsLabel());
|
$this->assertNotContains('foo', $res->getTagsLabel());
|
||||||
|
|
|
@ -50,7 +50,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
$client->request('GET', '/export/' . $content->getId() . '.doc');
|
$client->request('GET', '/export/' . $content->getId() . '.doc');
|
||||||
|
@ -91,7 +91,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findOneByUsernameAndNotArchived('admin');
|
->findOneByUsernameAndNotArchived('admin');
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -159,7 +159,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||||
// to be sure results are the same
|
// to be sure results are the same
|
||||||
$contentInDB = $client->getContainer()
|
$contentInDB = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->createQueryBuilder('e')
|
->createQueryBuilder('e')
|
||||||
->select('e, t')
|
->select('e, t')
|
||||||
->leftJoin('e.user', 'u')
|
->leftJoin('e.user', 'u')
|
||||||
|
@ -205,7 +205,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$contentInDB = $client->getContainer()
|
$contentInDB = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry1', $this->getLoggedInUserId());
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
@ -279,7 +279,7 @@ class ExportControllerTest extends WallabagCoreTestCase
|
||||||
// to be sure results are the same
|
// to be sure results are the same
|
||||||
$contentInDB = $client->getContainer()
|
$contentInDB = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->createQueryBuilder('e')
|
->createQueryBuilder('e')
|
||||||
->leftJoin('e.user', 'u')
|
->leftJoin('e.user', 'u')
|
||||||
->where('u.username = :username')->setParameter('username', 'admin')
|
->where('u.username = :username')->setParameter('username', 'admin')
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
namespace Tests\Wallabag\CoreBundle\Controller;
|
namespace Tests\Wallabag\CoreBundle\Controller;
|
||||||
|
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class FeedControllerTest extends WallabagCoreTestCase
|
class FeedControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -91,7 +93,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -112,7 +114,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -134,7 +136,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -156,7 +158,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -178,7 +180,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -206,7 +208,7 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$client = $this->getClient();
|
$client = $this->getClient();
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
|
|
||||||
$config = $user->getConfig();
|
$config = $user->getConfig();
|
||||||
|
@ -215,12 +217,12 @@ class FeedControllerTest extends WallabagCoreTestCase
|
||||||
$em->persist($config);
|
$em->persist($config);
|
||||||
|
|
||||||
$entry1 = $em
|
$entry1 = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find(1)
|
->find(1)
|
||||||
;
|
;
|
||||||
|
|
||||||
$entry4 = $em
|
$entry4 = $em
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find(4)
|
->find(4)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
namespace Tests\Wallabag\CoreBundle\Controller;
|
namespace Tests\Wallabag\CoreBundle\Controller;
|
||||||
|
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
class SecurityControllerTest extends WallabagCoreTestCase
|
class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -40,7 +41,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
$user->setEmailTwoFactor(true);
|
$user->setEmailTwoFactor(true);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -52,7 +53,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
// restore user
|
// restore user
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
$user->setEmailTwoFactor(false);
|
$user->setEmailTwoFactor(false);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -73,7 +74,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
$em = $client->getContainer()->get('doctrine.orm.entity_manager');
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
$user->setGoogleAuthenticatorSecret('26LDIHYGHNELOQEM');
|
$user->setGoogleAuthenticatorSecret('26LDIHYGHNELOQEM');
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
@ -85,7 +86,7 @@ class SecurityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
// restore user
|
// restore user
|
||||||
$user = $em
|
$user = $em
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUsername('admin');
|
->findOneByUsername('admin');
|
||||||
$user->setGoogleAuthenticatorSecret(null);
|
$user->setGoogleAuthenticatorSecret(null);
|
||||||
$em->persist($user);
|
$em->persist($user);
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\CoreBundle\Controller;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
use Wallabag\CoreBundle\Entity\Tag;
|
use Wallabag\CoreBundle\Entity\Tag;
|
||||||
|
use Wallabag\UserBundle\Entity\User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group Tag
|
* @group Tag
|
||||||
|
@ -77,7 +78,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$entry = $client->getContainer()
|
$entry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry2', $this->getLoggedInUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry2', $this->getLoggedInUserId());
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/view/' . $entry->getId());
|
$crawler = $client->request('GET', '/view/' . $entry->getId());
|
||||||
|
@ -93,7 +94,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$newEntry = $client->getContainer()
|
$newEntry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$tags = $newEntry->getTags()->toArray();
|
$tags = $newEntry->getTags()->toArray();
|
||||||
|
@ -138,7 +139,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$tag = $client->getContainer()
|
$tag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findOneByLabel($this->tagName);
|
->findOneByLabel($this->tagName);
|
||||||
|
|
||||||
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
|
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
|
||||||
|
@ -170,23 +171,23 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$tag = $client->getContainer()
|
$tag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findOneByLabel($this->tagName);
|
->findOneByLabel($this->tagName);
|
||||||
|
|
||||||
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
|
$this->assertNull($tag, $this->tagName . ' was removed because it begun an orphan tag');
|
||||||
|
|
||||||
$user = $this->getEntityManager()
|
$user = $this->getEntityManager()
|
||||||
->getRepository('WallabagUserBundle:User')
|
->getRepository(User::class)
|
||||||
->findOneByUserName('admin');
|
->findOneByUserName('admin');
|
||||||
|
|
||||||
$entry = $client->getContainer()
|
$entry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/foo', $user->getId());
|
->findByUrlAndUserId('http://0.0.0.0/foo', $user->getId());
|
||||||
|
|
||||||
$entry2 = $client->getContainer()
|
$entry2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/bar', $user->getId());
|
->findByUrlAndUserId('http://0.0.0.0/bar', $user->getId());
|
||||||
|
|
||||||
$this->assertEmpty($entry->getTagsLabel());
|
$this->assertEmpty($entry->getTagsLabel());
|
||||||
|
@ -205,7 +206,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$entry = $client->getContainer()
|
$entry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
|
->findByUrlAndUserId('http://0.0.0.0/entry4', $this->getLoggedInUserId());
|
||||||
|
|
||||||
$tag->addEntry($entry);
|
$tag->addEntry($entry);
|
||||||
|
@ -216,7 +217,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$tag = $client->getContainer()
|
$tag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findOneByEntryAndTagLabel($entry, $this->tagName);
|
->findOneByEntryAndTagLabel($entry, $this->tagName);
|
||||||
|
|
||||||
$crawler = $client->request('GET', '/tag/list/' . $tag->getSlug());
|
$crawler = $client->request('GET', '/tag/list/' . $tag->getSlug());
|
||||||
|
@ -269,12 +270,12 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$freshEntry = $client->getContainer()
|
$freshEntry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$freshEntry2 = $client->getContainer()
|
$freshEntry2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry2->getId());
|
->find($entry2->getId());
|
||||||
|
|
||||||
$tags = [];
|
$tags = [];
|
||||||
|
@ -293,7 +294,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$newTag = $client->getContainer()
|
$newTag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($newTagLabel);
|
->findByLabel($newTagLabel);
|
||||||
|
|
||||||
$this->assertCount(1, $newTag, 'New tag exists.');
|
$this->assertCount(1, $newTag, 'New tag exists.');
|
||||||
|
@ -333,7 +334,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$freshEntry = $client->getContainer()
|
$freshEntry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$tags = [];
|
$tags = [];
|
||||||
|
@ -347,7 +348,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$newTag = $client->getContainer()
|
$newTag = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($tagLabel);
|
->findByLabel($tagLabel);
|
||||||
|
|
||||||
$this->assertCount(1, $newTag);
|
$this->assertCount(1, $newTag);
|
||||||
|
@ -388,7 +389,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$freshEntry = $client->getContainer()
|
$freshEntry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$tags = [];
|
$tags = [];
|
||||||
|
@ -402,12 +403,12 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$tagFromRepo = $client->getContainer()
|
$tagFromRepo = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($tagLabel);
|
->findByLabel($tagLabel);
|
||||||
|
|
||||||
$newTagFromRepo = $client->getContainer()
|
$newTagFromRepo = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($newTagLabel);
|
->findByLabel($newTagLabel);
|
||||||
|
|
||||||
$this->assertCount(0, $newTagFromRepo);
|
$this->assertCount(0, $newTagFromRepo);
|
||||||
|
@ -458,22 +459,22 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$freshEntry1 = $client->getContainer()
|
$freshEntry1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry1->getId());
|
->find($entry1->getId());
|
||||||
|
|
||||||
$freshEntry2 = $client->getContainer()
|
$freshEntry2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry2->getId());
|
->find($entry2->getId());
|
||||||
|
|
||||||
$tagFromRepo = $client->getContainer()
|
$tagFromRepo = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($tagLabel);
|
->findByLabel($tagLabel);
|
||||||
|
|
||||||
$previousTagFromRepo = $client->getContainer()
|
$previousTagFromRepo = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Tag')
|
->getRepository(Tag::class)
|
||||||
->findByLabel($previousTagLabel);
|
->findByLabel($previousTagLabel);
|
||||||
|
|
||||||
$this->assertCount(1, $tagFromRepo);
|
$this->assertCount(1, $tagFromRepo);
|
||||||
|
@ -516,7 +517,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$newEntry = $client->getContainer()
|
$newEntry = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->find($entry->getId());
|
->find($entry->getId());
|
||||||
|
|
||||||
$tags = $newEntry->getTags()->toArray();
|
$tags = $newEntry->getTags()->toArray();
|
||||||
|
@ -549,7 +550,7 @@ class TagControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$entries = $client->getContainer()
|
$entries = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread')
|
->getBuilderForSearchByUser($this->getLoggedInUserId(), 'title', 'unread')
|
||||||
->getQuery()->getResult();
|
->getQuery()->getResult();
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class ChromeControllerTest extends WallabagCoreTestCase
|
class ChromeControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -113,7 +114,7 @@ class ChromeControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.20minutes.fr/sport/3256363-20220321-tournoi-vi-nations-trophee-gagne-xv-france-fini-fond-seine',
|
'https://www.20minutes.fr/sport/3256363-20220321-tournoi-vi-nations-trophee-gagne-xv-france-fini-fond-seine',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class DeliciousControllerTest extends WallabagCoreTestCase
|
class DeliciousControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -110,7 +111,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://feross.org/spoofmac/',
|
'https://feross.org/spoofmac/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -152,7 +153,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content1 = $client->getContainer()
|
$content1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://stackoverflow.com/review/',
|
'https://stackoverflow.com/review/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -162,7 +163,7 @@ class DeliciousControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content2 = $client->getContainer()
|
$content2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://addyosmani.com/basket.js/',
|
'https://addyosmani.com/basket.js/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class ElcuratorControllerTest extends WallabagCoreTestCase
|
class ElcuratorControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -114,7 +115,7 @@ class ElcuratorControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://devblog.lexik.fr/git/qualite-de-code-integration-de-php-git-hooks-dans-symfony2-2842',
|
'https://devblog.lexik.fr/git/qualite-de-code-integration-de-php-git-hooks-dans-symfony2-2842',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class FirefoxControllerTest extends WallabagCoreTestCase
|
class FirefoxControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -113,7 +114,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://lexpansion.lexpress.fr/high-tech/orange-offre-un-meilleur-reseau-mobile-que-bouygues-et-sfr-free-derriere_1811554.html',
|
'https://lexpansion.lexpress.fr/high-tech/orange-offre-un-meilleur-reseau-mobile-que-bouygues-et-sfr-free-derriere_1811554.html',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -127,7 +128,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.lemonde.fr/disparitions/article/2018/07/05/le-journaliste-et-cineaste-claude-lanzmann-est-mort_5326313_3382.html',
|
'https://www.lemonde.fr/disparitions/article/2018/07/05/le-journaliste-et-cineaste-claude-lanzmann-est-mort_5326313_3382.html',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class InstapaperControllerTest extends WallabagCoreTestCase
|
class InstapaperControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -113,7 +114,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->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/',
|
'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()
|
$this->getLoggedInUserId()
|
||||||
|
@ -130,7 +131,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe',
|
'https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -165,7 +166,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content1 = $client->getContainer()
|
$content1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://redditblog.com/2016/09/20/amp-and-reactredux/',
|
'https://redditblog.com/2016/09/20/amp-and-reactredux/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -175,7 +176,7 @@ class InstapaperControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content2 = $client->getContainer()
|
$content2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c',
|
'https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class PinboardControllerTest extends WallabagCoreTestCase
|
class PinboardControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -110,7 +111,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://ma.ttias.be/varnish-explained/',
|
'https://ma.ttias.be/varnish-explained/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -157,7 +158,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content1 = $client->getContainer()
|
$content1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://ilia.ws/files/nginx_torontophpug.pdf',
|
'https://ilia.ws/files/nginx_torontophpug.pdf',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -168,7 +169,7 @@ class PinboardControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content2 = $client->getContainer()
|
$content2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://developers.google.com/web/updates/2016/07/infinite-scroller',
|
'https://developers.google.com/web/updates/2016/07/infinite-scroller',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class ReadabilityControllerTest extends WallabagCoreTestCase
|
class ReadabilityControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -110,7 +111,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.20minutes.fr/bordeaux/2120479-20170823-bordeaux-poche-chocolatine-association-traduit-etudiants-etrangers-mots-sud-ouest',
|
'https://www.20minutes.fr/bordeaux/2120479-20170823-bordeaux-poche-chocolatine-association-traduit-etudiants-etrangers-mots-sud-ouest',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -155,7 +156,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content1 = $client->getContainer()
|
$content1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://blog.travis-ci.com/2016-07-28-what-we-learned-from-analyzing-2-million-travis-builds/',
|
'https://blog.travis-ci.com/2016-07-28-what-we-learned-from-analyzing-2-million-travis-builds/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -166,7 +167,7 @@ class ReadabilityControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content2 = $client->getContainer()
|
$content2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://facebook.github.io/graphql/October2016/',
|
'https://facebook.github.io/graphql/October2016/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class WallabagV1ControllerTest extends WallabagCoreTestCase
|
class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -111,7 +112,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur',
|
'http://www.framablog.org/index.php/post/2014/02/05/Framabag-service-libre-gratuit-interview-developpeur',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -156,7 +157,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content1 = $client->getContainer()
|
$content1 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'http://gilbert.pellegrom.me/recreating-the-square-slider',
|
'http://gilbert.pellegrom.me/recreating-the-square-slider',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -167,7 +168,7 @@ class WallabagV1ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content2 = $client->getContainer()
|
$content2 = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.wallabag.org/features/',
|
'https://www.wallabag.org/features/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace Tests\Wallabag\ImportBundle\Controller;
|
||||||
use Predis\Client;
|
use Predis\Client;
|
||||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||||
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
|
||||||
|
use Wallabag\CoreBundle\Entity\Entry;
|
||||||
|
|
||||||
class WallabagV2ControllerTest extends WallabagCoreTestCase
|
class WallabagV2ControllerTest extends WallabagCoreTestCase
|
||||||
{
|
{
|
||||||
|
@ -114,7 +115,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867',
|
'https://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
@ -133,7 +134,7 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase
|
||||||
|
|
||||||
$content = $client->getContainer()
|
$content = $client->getContainer()
|
||||||
->get('doctrine.orm.entity_manager')
|
->get('doctrine.orm.entity_manager')
|
||||||
->getRepository('WallabagCoreBundle:Entry')
|
->getRepository(Entry::class)
|
||||||
->findByUrlAndUserId(
|
->findByUrlAndUserId(
|
||||||
'https://www.mediapart.fr/',
|
'https://www.mediapart.fr/',
|
||||||
$this->getLoggedInUserId()
|
$this->getLoggedInUserId()
|
||||||
|
|
Loading…
Reference in a new issue