]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #2095 from wallabag/fix-2auth-form
authorJeremy Benoist <j0k3r@users.noreply.github.com>
Wed, 17 Aug 2016 13:17:07 +0000 (15:17 +0200)
committerGitHub <noreply@github.com>
Wed, 17 Aug 2016 13:17:07 +0000 (15:17 +0200)
Fix form user display when 2FA is disabled

.travis.yml
src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php
src/Wallabag/CoreBundle/Form/Type/ConfigType.php
src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig
src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig
tests/Wallabag/CoreBundle/Command/InstallCommandTest.php

index 1a33198a283ada9edf0a7c446f788eaa6dfc6bef..a387fc135e0dc1e12ac675ba6f545c2612a9f7c6 100644 (file)
@@ -20,6 +20,7 @@ php:
     - 5.5
     - 5.6
     - 7.0
+    - 7.1
     - nightly
     - hhvm
 
@@ -38,6 +39,7 @@ matrix:
           env: DB=pgsql  # driver for PostgreSQL currently unsupported by HHVM, requires 3rd party dependency
     allow_failures:
         - php: hhvm
+        - php: nightly
 
 # exclude v1 branches
 branches:
@@ -46,7 +48,8 @@ branches:
 
 before_script:
     - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;
-    - if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
+    # xdebug isn't enable for PHP 7.1
+    - if [[ $TRAVIS_PHP_VERSION != '7.1' && $TRAVIS_PHP_VERSION != 'hhvm' ]]; then phpenv config-rm xdebug.ini; fi
     - composer self-update --no-progress
     - if [[ "$DB" = "pgsql" ]]; then psql -c 'create database wallabag_test;' -U postgres; fi;
 
index b712ad152c13e1fc1d8a0830eb7b7978d41244ad..cb4bee83069562aa3caca4bced262dab32408dcf 100644 (file)
@@ -16,7 +16,7 @@ class StringToListTransformer implements DataTransformerInterface
     private $separator;
 
     /**
-     * @param string $separator The separator used in the list.
+     * @param string $separator The separator used in the list
      */
     public function __construct($separator = ',')
     {
index 74c53bf058d3825e39b0efdb005b6c0807622eb4..7d25cc80597a06c70544fba356c0d99101e916e4 100644 (file)
@@ -21,7 +21,9 @@ class ConfigType extends AbstractType
     {
         $this->themes = array_combine(
             $themes,
-            array_map(function ($s) { return ucwords(strtolower(str_replace('-', ' ', $s))); }, $themes)
+            array_map(function ($s) {
+                return ucwords(strtolower(str_replace('-', ' ', $s)));
+            }, $themes)
         );
 
         $this->languages = $languages;
index 14ef4a6411928b439e33b399bee866c40d2c2859..239d09ae7bd8ff7f13dd8aeb74d12884621476db 100644 (file)
@@ -25,7 +25,7 @@ class RuleBasedTagger
     /**
      * Add tags from rules defined by the user.
      *
-     * @param Entry $entry Entry to tag.
+     * @param Entry $entry Entry to tag
      */
     public function tag(Entry $entry)
     {
@@ -49,7 +49,7 @@ class RuleBasedTagger
      *
      * @param User $user
      *
-     * @return array<Entry> A list of modified entries.
+     * @return array<Entry> A list of modified entries
      */
     public function tagAllForUser(User $user)
     {
@@ -75,7 +75,7 @@ class RuleBasedTagger
     /**
      * Fetch a tag.
      *
-     * @param string $label The tag's label.
+     * @param string $label The tag's label
      *
      * @return Tag
      */
index c51f90d2c5360ad6a8495726072fb0772e2a8210..a8abe8d3de3fb813f2f487a4552911b4cdd58ae8 100644 (file)
         </fieldset>
         {% endif %}
 
-        {{ form_rest(form.user) }}
+        {{ form_widget(form.user._token) }}
+        {{ form_widget(form.user.save) }}
     </form>
 
     <h2>{{ 'config.tab_menu.password'|trans }}</h2>
index 5a90f2273ad2a5d2b952bca863ef3c2de786c246..afd5b499a0da00377c29e023c9d31eb7c10e4046 100644 (file)
                             {% endif %}
 
                             {{ form_widget(form.user.save, {'attr': {'class': 'btn waves-effect waves-light'}}) }}
-                            {{ form_rest(form.user) }}
+                            {{ form_widget(form.user._token) }}
                         </form>
                     </div>
 
index 6c6ce0873ff40ee73f85146243e7ccbd6603c673..089a1c5fee9a36a2ec6d093d66373581648859d8 100644 (file)
@@ -28,16 +28,32 @@ class InstallCommandTest extends WallabagCoreTestCase
              *
              * http://stackoverflow.com/a/14374832/569101
              */
-            $this->markTestSkipped('PostgreSQL spotted: can find a good way to drop current database, skipping.');
+            $this->markTestSkipped('PostgreSQL spotted: can\'t find a good way to drop current database, skipping.');
         }
     }
 
+    /**
+     * Ensure next tests will have a clean database
+     */
     public static function tearDownAfterClass()
     {
         $application = new Application(static::$kernel);
         $application->setAutoExit(false);
 
-        $code = $application->run(new ArrayInput([
+        $application->run(new ArrayInput([
+            'command' => 'doctrine:schema:drop',
+            '--no-interaction' => true,
+            '--force' => true,
+            '--env' => 'test',
+        ]), new NullOutput());
+
+        $application->run(new ArrayInput([
+            'command' => 'doctrine:schema:create',
+            '--no-interaction' => true,
+            '--env' => 'test',
+        ]), new NullOutput());
+
+        $application->run(new ArrayInput([
             'command' => 'doctrine:fixtures:load',
             '--no-interaction' => true,
             '--env' => 'test',