]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Jump to Symfony 3.4 3731/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 4 Oct 2018 12:07:20 +0000 (14:07 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 4 Oct 2018 12:11:57 +0000 (14:11 +0200)
Thanks to the BC compatibility, almost nothing have to be changed.
All changes are related to new bundle version of:
- SensioFrameworkExtraBundle
- DoctrineFixturesBundle

34 files changed:
app/AppKernel.php
app/config/config.yml
app/config/config_test.yml
app/config/security.yml
app/config/services.yml
app/config/services_test.yml [new file with mode: 0644]
composer.json
src/Wallabag/ApiBundle/Controller/DeveloperController.php
src/Wallabag/CoreBundle/Controller/ConfigController.php
src/Wallabag/CoreBundle/Controller/EntryController.php
src/Wallabag/CoreBundle/Controller/ExportController.php
src/Wallabag/CoreBundle/Controller/RssController.php
src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
src/Wallabag/CoreBundle/Controller/StaticController.php
src/Wallabag/CoreBundle/Controller/TagController.php
src/Wallabag/CoreBundle/Resources/config/services.yml
src/Wallabag/ImportBundle/Controller/BrowserController.php
src/Wallabag/ImportBundle/Controller/ChromeController.php
src/Wallabag/ImportBundle/Controller/FirefoxController.php
src/Wallabag/ImportBundle/Controller/ImportController.php
src/Wallabag/ImportBundle/Controller/InstapaperController.php
src/Wallabag/ImportBundle/Controller/PinboardController.php
src/Wallabag/ImportBundle/Controller/PocketController.php
src/Wallabag/ImportBundle/Controller/ReadabilityController.php
src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
src/Wallabag/ImportBundle/Resources/config/services.yml
src/Wallabag/UserBundle/Controller/ManageController.php
tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php
tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
tests/Wallabag/ApiBundle/WallabagApiTestCase.php
tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php
tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
tests/Wallabag/CoreBundle/WallabagCoreTestCase.php

index 40726f0549cc9c756e08a1a00f2cf989859a43a0..546794deb92c3724582f47757087affff38dc6e7 100644 (file)
@@ -32,6 +32,7 @@ class AppKernel extends Kernel
             new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
             new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
             new BD\GuzzleSiteAuthenticatorBundle\BDGuzzleSiteAuthenticatorBundle(),
+            new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
 
             // wallabag bundles
             new Wallabag\CoreBundle\WallabagCoreBundle(),
@@ -39,7 +40,6 @@ class AppKernel extends Kernel
             new Wallabag\UserBundle\WallabagUserBundle(),
             new Wallabag\ImportBundle\WallabagImportBundle(),
             new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
-            new OldSound\RabbitMqBundle\OldSoundRabbitMqBundle(),
         ];
 
         if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
index 0c2b6a1daf02dbc8f54129d87bc806c632089bd3..951cdf71865ec0850f301a57b3529b7b789b9fea 100644 (file)
@@ -357,3 +357,8 @@ jms_serializer:
         # see: https://github.com/schmittjoh/JMSSerializerBundle/pull/494
         datetime:
             default_format: "Y-m-d\\TH:i:sO" # ATOM
+
+# see https://github.com/symfony/symfony-standard/pull/1133
+sensio_framework_extra:
+   router:
+        annotations: false
index fc067ff46892d2cf646f5dbad992d4d96574771b..11e0feb778d92c48a71732150e110cb3e9376680 100644 (file)
@@ -1,6 +1,7 @@
 imports:
     - { resource: config_dev.yml }
     - { resource: parameters_test.yml }
+    - { resource: services_test.yml }
 
 framework:
     test: ~
index 02afc9eaaa1f96d31b23e00f3cff61bc2b38cbf3..98f43011f961bd7d48225c16d9132006937b9a84 100644 (file)
@@ -31,12 +31,15 @@ security:
             fos_oauth: true
             stateless: true
             anonymous: true
+            provider: fos_userbundle
 
         login_firewall:
+            logout_on_user_change: true
             pattern: ^/login$
             anonymous:  ~
 
         secured_area:
+            logout_on_user_change: true
             pattern: ^/
             form_login:
                 provider: fos_userbundle
index 7b85d846bbbe5dea783885eec1c9aec8005b7ad4..25bbe5dc007d4e4fc11c01c11e2aed42a059c2c2 100644 (file)
@@ -2,12 +2,6 @@ parameters:
     lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
 
 services:
-    # used for tests
-    filesystem_cache:
-        class: Doctrine\Common\Cache\FilesystemCache
-        arguments:
-            - "%kernel.cache_dir%/doctrine/metadata"
-
     twig.extension.text:
         class: Twig_Extensions_Extension_Text
         tags:
diff --git a/app/config/services_test.yml b/app/config/services_test.yml
new file mode 100644 (file)
index 0000000..a300f75
--- /dev/null
@@ -0,0 +1,38 @@
+services:
+    # see https://github.com/symfony/symfony/issues/24543
+    fos_user.user_manager.test:
+        alias: fos_user.user_manager
+        public: true
+
+    fos_user.security.login_manager.test:
+        alias: fos_user.security.login_manager
+        public: true
+
+    wallabag_core.entry_repository.test:
+        alias: wallabag_core.entry_repository
+        public: true
+
+    wallabag_user.user_repository.test:
+        alias: wallabag_user.user_repository
+        public: true
+
+    filesystem_cache:
+        class: Doctrine\Common\Cache\FilesystemCache
+        arguments:
+            - "%kernel.cache_dir%/doctrine/metadata"
+
+    # fixtures
+    Wallabag\AnnotationBundle\DataFixtures\ORM\:
+        resource: '../../src/Wallabag/AnnotationBundle/DataFixtures/ORM/*'
+        tags: ['doctrine.fixture.orm']
+        autowire: true
+
+    Wallabag\CoreBundle\DataFixtures\ORM\:
+        resource: '../../src/Wallabag/CoreBundle/DataFixtures/ORM/*'
+        tags: ['doctrine.fixture.orm']
+        autowire: true
+
+    Wallabag\UserBundle\DataFixtures\ORM\:
+        resource: '../../src/Wallabag/UserBundle/DataFixtures/ORM/*'
+        tags: ['doctrine.fixture.orm']
+        autowire: true
index 9ed91f20d575daad6015ff2f3809c99c6045bb44..f209a5c22369558a4a56cdf9e48c850afd518342 100644 (file)
@@ -43,7 +43,7 @@
         "ext-iconv": "*",
         "ext-tokenizer": "*",
         "ext-pdo": "*",
-        "symfony/symfony": "~3.3.13",
+        "symfony/symfony": "3.4.*",
         "doctrine/orm": "^2.5.12",
         "doctrine/doctrine-bundle": "^1.8.0",
         "doctrine/doctrine-cache-bundle": "^1.3.2",
@@ -51,7 +51,7 @@
         "symfony/swiftmailer-bundle": "^2.6.7",
         "symfony/monolog-bundle": "^3.1.2",
         "sensio/distribution-bundle": "^5.0.21",
-        "sensio/framework-extra-bundle": "^3.0.28",
+        "sensio/framework-extra-bundle": "^5.2.1",
         "incenteev/composer-parameter-handler": "^2.1.2",
         "nelmio/cors-bundle": "~1.5",
         "friendsofsymfony/rest-bundle": "~2.1",
         "predis/predis": "^1.1.1",
         "javibravo/simpleue": "^2.0",
         "symfony/dom-crawler": "^3.3.13",
-        "friendsofsymfony/jsrouting-bundle": "^1.6.3",
+        "friendsofsymfony/jsrouting-bundle": "^2.2.1",
         "bdunogier/guzzle-site-authenticator": "^1.0.0@dev",
         "defuse/php-encryption": "^2.1",
         "html2text/html2text": "^4.1"
     },
     "require-dev": {
-        "doctrine/doctrine-fixtures-bundle": "~2.2",
-        "doctrine/data-fixtures": "~1.1",
+        "doctrine/doctrine-fixtures-bundle": "~3.0",
         "sensio/generator-bundle": "^3.0",
         "symfony/phpunit-bridge": "^3.3",
         "friendsofphp/php-cs-fixer": "~2.0",
index c7178017ef349f7a95e0eb35d28a3f93dd2e75a2..ae7e83daf2086974b1764b60a00f96fd90d08f64 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace Wallabag\ApiBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\ApiBundle\Entity\Client;
 use Wallabag\ApiBundle\Form\Type\ClientType;
 
index b999c539f1aa32a7c387cc0b9b80dbc35c7ad91e..242f557f0fad1c4510182db11d43a5094f9db25b 100644 (file)
@@ -2,12 +2,12 @@
 
 namespace Wallabag\CoreBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\CoreBundle\Entity\Config;
 use Wallabag\CoreBundle\Entity\TaggingRule;
 use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
index 294008339356d3b5187494b7fee5d2c65362d505..ac372a333594f20a48c925d95272130ee96b7d5c 100644 (file)
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller;
 use Pagerfanta\Adapter\DoctrineORMAdapter;
 use Pagerfanta\Exception\OutOfRangeCurrentPageException;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Event\EntryDeletedEvent;
index 7ca89239430dc7b2ec3da1d18fd1b88779ee944e..0d2b15c5238d8cde8becf7ffb16c7899b5bb22a4 100644 (file)
@@ -2,10 +2,10 @@
 
 namespace Wallabag\CoreBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\CoreBundle\Entity\Entry;
 
 /**
index 848bb8140ac61faa370651daa937005b8b39b383..1c831c0395491ae59fdaa9bf12a707109a838f2d 100644 (file)
@@ -7,10 +7,10 @@ use Pagerfanta\Adapter\DoctrineORMAdapter;
 use Pagerfanta\Exception\OutOfRangeCurrentPageException;
 use Pagerfanta\Pagerfanta;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
 use Wallabag\CoreBundle\Entity\Tag;
 use Wallabag\UserBundle\Entity\User;
index 548de74486287c3076311338065cabcd660ede50..51bc1d94ae13dc9d897baaaf17683c50175bc927 100644 (file)
@@ -2,10 +2,9 @@
 
 namespace Wallabag\CoreBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\CoreBundle\Entity\SiteCredential;
 use Wallabag\UserBundle\Entity\User;
 
@@ -19,8 +18,7 @@ class SiteCredentialController extends Controller
     /**
      * Lists all User entities.
      *
-     * @Route("/", name="site_credentials_index")
-     * @Method("GET")
+     * @Route("/", name="site_credentials_index", methods={"GET"})
      */
     public function indexAction()
     {
@@ -36,8 +34,7 @@ class SiteCredentialController extends Controller
     /**
      * Creates a new site credential entity.
      *
-     * @Route("/new", name="site_credentials_new")
-     * @Method({"GET", "POST"})
+     * @Route("/new", name="site_credentials_new", methods={"GET", "POST"})
      *
      * @param Request $request
      *
@@ -77,8 +74,7 @@ class SiteCredentialController extends Controller
     /**
      * Displays a form to edit an existing site credential entity.
      *
-     * @Route("/{id}/edit", name="site_credentials_edit")
-     * @Method({"GET", "POST"})
+     * @Route("/{id}/edit", name="site_credentials_edit", methods={"GET", "POST"})
      *
      * @param Request        $request
      * @param SiteCredential $siteCredential
@@ -121,8 +117,7 @@ class SiteCredentialController extends Controller
     /**
      * Deletes a site credential entity.
      *
-     * @Route("/{id}", name="site_credentials_delete")
-     * @Method("DELETE")
+     * @Route("/{id}", name="site_credentials_delete", methods={"DELETE"})
      *
      * @param Request        $request
      * @param SiteCredential $siteCredential
index 318af303c361bda37acf27e06176560dadc64ced..fa760c14414be97a6066c3634724f95db0e1630b 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\CoreBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Routing\Annotation\Route;
 
 class StaticController extends Controller
 {
index b6d28e59d63c73a2fb925f63ebacb72f18d69ed2..15f06ff522b6adeca5667a99b6a843cf995aca0b 100644 (file)
@@ -5,9 +5,9 @@ namespace Wallabag\CoreBundle\Controller;
 use Pagerfanta\Adapter\ArrayAdapter;
 use Pagerfanta\Exception\OutOfRangeCurrentPageException;
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\CoreBundle\Entity\Entry;
 use Wallabag\CoreBundle\Entity\Tag;
 use Wallabag\CoreBundle\Form\Type\NewTagType;
index 85306276db9c24d1290a000834576b0e7285a9fb..a27dd2108b374fc42aefd308b10095aa4cee1216 100644 (file)
@@ -181,6 +181,7 @@ services:
 
     wallabag_core.exception_controller:
         class: Wallabag\CoreBundle\Controller\ExceptionController
+        public: true
         arguments:
             - '@twig'
             - '%kernel.debug%'
@@ -218,3 +219,31 @@ services:
         arguments:
             - "%wallabag_core.site_credentials.encryption_key_path%"
             - "@logger"
+
+    wallabag_core.command.clean_duplicates:
+        class: Wallabag\CoreBundle\Command\CleanDuplicatesCommand
+        tags: ['console.command']
+
+    wallabag_core.command.export:
+        class: Wallabag\CoreBundle\Command\ExportCommand
+        tags: ['console.command']
+
+    wallabag_core.command.install:
+        class: Wallabag\CoreBundle\Command\InstallCommand
+        tags: ['console.command']
+
+    wallabag_core.command.list_user:
+        class: Wallabag\CoreBundle\Command\ListUserCommand
+        tags: ['console.command']
+
+    wallabag_core.command.reload_entry:
+        class: Wallabag\CoreBundle\Command\ReloadEntryCommand
+        tags: ['console.command']
+
+    wallabag_core.command.show_user:
+        class: Wallabag\CoreBundle\Command\ShowUserCommand
+        tags: ['console.command']
+
+    wallabag_core.command.tag_all:
+        class: Wallabag\CoreBundle\Command\TagAllCommand
+        tags: ['console.command']
index 6418925c0c9c21efb31f48a5f42007c3e84d996f..58d2a7303c5dbc1c7c0273df4cf7db4313e9ea85 100644 (file)
@@ -2,10 +2,10 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\ImportBundle\Form\Type\UploadImportType;
 
 abstract class BrowserController extends Controller
index 0cb418a1aa4f802efaf34bab150fe74dd4eefe9a..6628cdb0bd4fa49beaf04cdf3d54a41cdcbfc8f7 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 
 class ChromeController extends BrowserController
 {
index 88697f9dc0a9edc7d87e415d047f7153569f306a..dce8455f31a10463f82a70f344b260fe4641ff1e 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 
 class FirefoxController extends BrowserController
 {
index 7e4fd17442f6235b27f9a0f651002f28f0f525e6..fbd7434e523d4de869f7e33f04a5a4f9aaa5b6a8 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
+use Symfony\Component\Routing\Annotation\Route;
 
 class ImportController extends Controller
 {
index f184baf91ee7b708c1525b0db22c90c5410bb9fe..faed3b728437c0a0a365e8bb8d929615c34ddba0 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\ImportBundle\Form\Type\UploadImportType;
 
 class InstapaperController extends Controller
index 6f54c69a0fd5d4fc1abb9cf8fc7a0c9850c9c883..cc6fae7985bd4a49d04d2bbe7b20e54170c3e85b 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\ImportBundle\Form\Type\UploadImportType;
 
 class PinboardController extends Controller
index 9f28819aae2ac3bb591d97c0a19c437fddbb90e3..71ceb4276d8378cbcaf64620871769a8fe7a02c9 100644 (file)
@@ -2,10 +2,10 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
 
 class PocketController extends Controller
index 729a97a3bbb90bf39c526c6546043dd6cc1f59a7..b120ef9678e30c376f299a002454ac5a9c1b3f90 100644 (file)
@@ -2,9 +2,9 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\ImportBundle\Form\Type\UploadImportType;
 
 class ReadabilityController extends Controller
index d700d8a883a38ca7a09f1fb0f02343cceff37c79..e1c35343851b4071781e204711011c2c96e52983 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 
 class WallabagV1Controller extends WallabagController
 {
index ab26400cfb1e445b2a5310a72df85139f5a44a0e..c4116c1d02562e91e55456d79010f2a262d464b2 100644 (file)
@@ -2,8 +2,8 @@
 
 namespace Wallabag\ImportBundle\Controller;
 
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 
 class WallabagV2Controller extends WallabagController
 {
index b224a6a2341266eefa6cfde691f9f5d9463a7862..2dd7dff8cd8b391b3f4edde560f91723a7690164 100644 (file)
@@ -112,3 +112,11 @@ services:
             - [ setLogger, [ "@logger" ]]
         tags:
             -  { name: wallabag_import.import, alias: chrome }
+
+    wallabag_import.command.import:
+        class: Wallabag\ImportBundle\Command\ImportCommand
+        tags: ['console.command']
+
+    wallabag_import.command.redis_worker:
+        class: Wallabag\ImportBundle\Command\RedisWorkerCommand
+        tags: ['console.command']
index f3de656f979d1b16891a2c9bea394bf8439a1272..a9746fb47d1ecc5c431e9b58862081c5bbe44a92 100644 (file)
@@ -7,10 +7,9 @@ use FOS\UserBundle\FOSUserEvents;
 use Pagerfanta\Adapter\DoctrineORMAdapter;
 use Pagerfanta\Exception\OutOfRangeCurrentPageException;
 use Pagerfanta\Pagerfanta;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\Routing\Annotation\Route;
 use Wallabag\UserBundle\Entity\User;
 use Wallabag\UserBundle\Form\SearchUserType;
 
@@ -22,8 +21,7 @@ class ManageController extends Controller
     /**
      * Creates a new User entity.
      *
-     * @Route("/new", name="user_new")
-     * @Method({"GET", "POST"})
+     * @Route("/new", name="user_new", methods={"GET", "POST"})
      */
     public function newAction(Request $request)
     {
@@ -60,8 +58,7 @@ class ManageController extends Controller
     /**
      * Displays a form to edit an existing User entity.
      *
-     * @Route("/{id}/edit", name="user_edit")
-     * @Method({"GET", "POST"})
+     * @Route("/{id}/edit", name="user_edit", methods={"GET", "POST"})
      */
     public function editAction(Request $request, User $user)
     {
@@ -93,8 +90,7 @@ class ManageController extends Controller
     /**
      * Deletes a User entity.
      *
-     * @Route("/{id}", name="user_delete")
-     * @Method("DELETE")
+     * @Route("/{id}", name="user_delete", methods={"DELETE"})
      */
     public function deleteAction(Request $request, User $user)
     {
index 105e8add20c5f2c8f470066caa9c315c34339701..9c7aba6bde51b019fe6de58d96fa685269667c62 100644 (file)
@@ -43,9 +43,9 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
         $container = $client->getContainer();
 
         /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
-        $userManager = $container->get('fos_user.user_manager');
+        $userManager = $container->get('fos_user.user_manager.test');
         /** @var $loginManager \FOS\UserBundle\Security\LoginManager */
-        $loginManager = $container->get('fos_user.security.login_manager');
+        $loginManager = $container->get('fos_user.security.login_manager.test');
         $firewallName = $container->getParameter('fos_user.firewall_name');
 
         $this->user = $userManager->findUserBy(['username' => 'admin']);
index f58d1c12027f9bb5a6e259311f8b9ca19206832d..090155d79294d03c38405068042bd799bf9e615b 100644 (file)
@@ -121,7 +121,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
     {
         $client = $this->getClient();
         $em = $client->getContainer()->get('doctrine.orm.entity_manager');
-        $userManager = $client->getContainer()->get('fos_user.user_manager');
+        $userManager = $client->getContainer()->get('fos_user.user_manager.test');
         $user = $userManager->findUserBy(['username' => $username]);
         $apiClient = new Client($user);
         $apiClient->setName('My app');
index 8a188e1c9e26c335b3dbc632b9be811ddfa1b253..0c52aea06addf2deae3e94a45c0bd0b34530b87a 100644 (file)
@@ -31,9 +31,9 @@ abstract class WallabagApiTestCase extends WebTestCase
         $container = $client->getContainer();
 
         /** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
-        $userManager = $container->get('fos_user.user_manager');
+        $userManager = $container->get('fos_user.user_manager.test');
         /** @var $loginManager \FOS\UserBundle\Security\LoginManager */
-        $loginManager = $container->get('fos_user.security.login_manager');
+        $loginManager = $container->get('fos_user.security.login_manager.test');
         $firewallName = $container->getParameter('fos_user.firewall_name');
 
         $this->user = $userManager->findUserBy(['username' => 'admin']);
index b13f6519a04a00c0aa3048f6e8345b6ea7a000e1..c4bd6dacecbc50d1317e00b30c6939332d01df28 100644 (file)
@@ -26,7 +26,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
     {
         parent::setUp();
 
-        $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository');
+        $userRepository = $this->getClient()->getContainer()->get('wallabag_user.user_repository.test');
 
         $user = $userRepository->findOneByUserName('admin');
         $this->adminEntry = new Entry($user);
@@ -60,7 +60,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
 
         $reloadedEntries = $this->getClient()
             ->getContainer()
-            ->get('wallabag_core.entry_repository')
+            ->get('wallabag_core.entry_repository.test')
             ->findById([$this->adminEntry->getId(), $this->bobEntry->getId()]);
 
         foreach ($reloadedEntries as $reloadedEntry) {
@@ -84,7 +84,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase
             'interactive' => false,
         ]);
 
-        $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository');
+        $entryRepository = $this->getClient()->getContainer()->get('wallabag_core.entry_repository.test');
 
         $reloadedAdminEntry = $entryRepository->find($this->adminEntry->getId());
         $this->assertNotEmpty($reloadedAdminEntry->getContent());
index 0ac119d86f2a2546db948f5d153da14281401f0d..6effe43e883412f5d2bf40a0470e4875ae82f5a9 100644 (file)
@@ -985,8 +985,13 @@ class EntryControllerTest extends WallabagCoreTestCase
         $client->request('GET', '/share/' . $content->getId());
         $this->assertSame(302, $client->getResponse()->getStatusCode());
 
-        // follow link with uid
-        $crawler = $client->followRedirect();
+        $shareUrl = $client->getResponse()->getTargetUrl();
+
+        // use a new client to have a fresh empty session (instead of a logged one from the previous client)
+        $client->restart();
+
+        $client->request('GET', $shareUrl);
+
         $this->assertSame(200, $client->getResponse()->getStatusCode());
         $this->assertContains('max-age=25200', $client->getResponse()->headers->get('cache-control'));
         $this->assertContains('public', $client->getResponse()->headers->get('cache-control'));
@@ -1002,9 +1007,6 @@ class EntryControllerTest extends WallabagCoreTestCase
         $client->request('GET', '/share/' . $content->getUid());
         $this->assertSame(404, $client->getResponse()->getStatusCode());
 
-        $client->request('GET', '/view/' . $content->getId());
-        $this->assertContains('no-cache', $client->getResponse()->headers->get('cache-control'));
-
         // removing the share
         $client->request('GET', '/share/delete/' . $content->getId());
         $this->assertSame(302, $client->getResponse()->getStatusCode());
index 6e1163c56ce2a285cf8499e448ed578e16c87839..816d22f4d8d303e627baa2bd3d041b0e23d7a27c 100644 (file)
@@ -84,8 +84,8 @@ abstract class WallabagCoreTestCase extends WebTestCase
         $container = $this->client->getContainer();
         $session = $container->get('session');
 
-        $userManager = $container->get('fos_user.user_manager');
-        $loginManager = $container->get('fos_user.security.login_manager');
+        $userManager = $container->get('fos_user.user_manager.test');
+        $loginManager = $container->get('fos_user.security.login_manager.test');
         $firewallName = $container->getParameter('fos_user.firewall_name');
 
         $user = $userManager->findUserBy(['username' => $username]);