From 23634d5d842dabcf5d7475e2becb7e127824239e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 1 Jun 2016 21:27:35 +0200 Subject: [PATCH] Jump to Symfony 3.1 --- .travis.yml | 2 +- app/config/config.yml | 10 +++++----- app/config/config_dev.yml | 4 ++-- app/config/config_prod.yml | 4 ++-- bin/phpunit | 1 - composer.json | 7 +++++-- phpunit.xml.dist | 16 ++++++---------- src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 2 -- .../CoreBundle/Form/Type/EntryFilterType.php | 1 - .../Controller/AnnotationControllerTest.php | 4 ++-- .../WallabagAnnotationTestCase.php | 2 +- .../Controller/WallabagRestControllerTest.php | 4 ++-- .../Wallabag/ApiBundle}/WallabagApiTestCase.php | 2 +- .../CoreBundle}/Command/InstallCommandTest.php | 6 +++--- .../CoreBundle}/Command/TagAllCommandTest.php | 4 ++-- .../Controller/ConfigControllerTest.php | 4 ++-- .../Controller/DeveloperControllerTest.php | 4 ++-- .../Controller/EntryControllerTest.php | 4 ++-- .../Controller/ExportControllerTest.php | 4 ++-- .../CoreBundle}/Controller/RssControllerTest.php | 4 ++-- .../Controller/SecurityControllerTest.php | 4 ++-- .../Controller/SettingsControllerTest.php | 4 ++-- .../Controller/StaticControllerTest.php | 4 ++-- .../CoreBundle}/Controller/TagControllerTest.php | 4 ++-- .../EventListener/LocaleListenerTest.php | 2 +- .../RegistrationConfirmedListenerTest.php | 2 +- .../EventListener/UserLocaleListenerTest.php | 2 +- .../StringToListTransformerTest.php | 2 +- .../CoreBundle}/Helper/ContentProxyTest.php | 2 +- .../Wallabag/CoreBundle}/Helper/RedirectTest.php | 2 +- .../CoreBundle}/Helper/RuleBasedTaggerTest.php | 2 +- .../CoreBundle}/Mock/InstallCommandMock.php | 2 +- .../UsernameRssTokenConverterTest.php | 2 +- .../Subscriber/TablePrefixSubscriberTest.php | 2 +- .../CoreBundle}/Twig/WallabagExtensionTest.php | 2 +- .../CoreBundle}/WallabagCoreTestCase.php | 2 +- .../Controller/ImportControllerTest.php | 4 ++-- .../Controller/PocketControllerTest.php | 4 ++-- .../Controller/WallabagV1ControllerTest.php | 4 ++-- .../Controller/WallabagV2ControllerTest.php | 4 ++-- .../ImportBundle}/Import/ImportChainTest.php | 2 +- .../Import/ImportCompilerPassTest.php | 2 +- .../ImportBundle}/Import/PocketImportTest.php | 2 +- .../Import/WallabagV1ImportTest.php | 2 +- .../Import/WallabagV2ImportTest.php | 2 +- .../Wallabag/ImportBundle}/fixtures/test.html | 0 .../Wallabag/ImportBundle}/fixtures/test.txt | 0 .../ImportBundle}/fixtures/wallabag-v1-read.json | 0 .../ImportBundle}/fixtures/wallabag-v1.json | 0 .../ImportBundle}/fixtures/wallabag-v2-read.json | 0 .../ImportBundle}/fixtures/wallabag-v2.json | 0 .../UserBundle}/Mailer/AuthCodeMailerTest.php | 2 +- web/app.php | 10 ---------- 53 files changed, 76 insertions(+), 91 deletions(-) delete mode 120000 bin/phpunit rename {src/Wallabag/AnnotationBundle/Tests => tests/Wallabag/AnnotationBundle}/Controller/AnnotationControllerTest.php (97%) rename {src/Wallabag/AnnotationBundle/Tests => tests/Wallabag/AnnotationBundle}/WallabagAnnotationTestCase.php (97%) rename {src/Wallabag/ApiBundle/Tests => tests/Wallabag/ApiBundle}/Controller/WallabagRestControllerTest.php (99%) rename {src/Wallabag/ApiBundle/Tests => tests/Wallabag/ApiBundle}/WallabagApiTestCase.php (97%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Command/InstallCommandTest.php (98%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Command/TagAllCommandTest.php (94%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/ConfigControllerTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/DeveloperControllerTest.php (95%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/EntryControllerTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/ExportControllerTest.php (98%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/RssControllerTest.php (97%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/SecurityControllerTest.php (95%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/SettingsControllerTest.php (88%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/StaticControllerTest.php (84%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Controller/TagControllerTest.php (97%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/EventListener/LocaleListenerTest.php (98%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/EventListener/RegistrationConfirmedListenerTest.php (97%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/EventListener/UserLocaleListenerTest.php (97%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Form/DataTransformer/StringToListTransformerTest.php (96%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Helper/ContentProxyTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Helper/RedirectTest.php (96%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Helper/RuleBasedTaggerTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Mock/InstallCommandMock.php (92%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/ParamConverter/UsernameRssTokenConverterTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Subscriber/TablePrefixSubscriberTest.php (99%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/Twig/WallabagExtensionTest.php (91%) rename {src/Wallabag/CoreBundle/Tests => tests/Wallabag/CoreBundle}/WallabagCoreTestCase.php (96%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Controller/ImportControllerTest.php (87%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Controller/PocketControllerTest.php (95%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Controller/WallabagV1ControllerTest.php (97%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Controller/WallabagV2ControllerTest.php (97%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Import/ImportChainTest.php (92%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Import/ImportCompilerPassTest.php (96%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Import/PocketImportTest.php (99%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Import/WallabagV1ImportTest.php (99%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/Import/WallabagV2ImportTest.php (99%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/test.html (100%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/test.txt (100%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/wallabag-v1-read.json (100%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/wallabag-v1.json (100%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/wallabag-v2-read.json (100%) rename {src/Wallabag/ImportBundle/Tests => tests/Wallabag/ImportBundle}/fixtures/wallabag-v2.json (100%) rename {src/Wallabag/UserBundle/Tests => tests/Wallabag/UserBundle}/Mailer/AuthCodeMailerTest.php (98%) diff --git a/.travis.yml b/.travis.yml index d397c872..7fe15c5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,6 @@ before_install: script: - travis_wait composer install --no-interaction --no-progress --prefer-dist -o - ant prepare-$DB - - bin/phpunit -v + - phpunit -v - if [ "$CS_FIXER" = "run" ]; then php bin/php-cs-fixer fix src/ --verbose --dry-run ; fi; - if [ "$VALIDATE_TRANSLATION_FILE" = "run" ]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi; diff --git a/app/config/config.yml b/app/config/config.yml index ea028d85..9e2e08a6 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -169,7 +169,7 @@ liip_theme: path_patterns: bundle_resource: - - %%bundle_path%%/Resources/views/themes/%%current_theme%%/%%template%% + - "%%bundle_path%%/Resources/views/themes/%%current_theme%%/%%template%%" fos_user: db_driver: orm @@ -177,9 +177,9 @@ fos_user: user_class: Wallabag\UserBundle\Entity\User registration: confirmation: - enabled: %fosuser_confirmation% + enabled: "%fosuser_confirmation%" from_email: - address: %from_email% + address: "%from_email%" sender_name: wallabag fos_oauth_server: db_driver: orm @@ -197,8 +197,8 @@ scheb_two_factor: cookie_lifetime: 2592000 email: - enabled: %twofactor_auth% - sender_email: %twofactor_sender% + enabled: "%twofactor_auth%" + sender_email: "%twofactor_sender%" digits: 6 template: WallabagUserBundle:Authentication:form.html.twig mailer: wallabag_user.auth_code_mailer diff --git a/app/config/config_dev.yml b/app/config/config_dev.yml index 2813e369..ec23babb 100644 --- a/app/config/config_dev.yml +++ b/app/config/config_dev.yml @@ -17,14 +17,14 @@ monolog: type: stream path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug - channels: [!event] + channels: ['!event'] console: type: console bubble: false verbosity_levels: VERBOSITY_VERBOSE: INFO VERBOSITY_VERY_VERBOSE: DEBUG - channels: [!event, !doctrine] + channels: ['!event', '!doctrine'] console_very_verbose: type: console bubble: false diff --git a/app/config/config_prod.yml b/app/config/config_prod.yml index 342837a0..65b040cc 100644 --- a/app/config/config_prod.yml +++ b/app/config/config_prod.yml @@ -2,8 +2,8 @@ imports: - { resource: config.yml } #framework: -# validation: -# cache: apc +# cache: +# system: cache.adapter.apcu #doctrine: # orm: diff --git a/bin/phpunit b/bin/phpunit deleted file mode 120000 index 4ba32564..00000000 --- a/bin/phpunit +++ /dev/null @@ -1 +0,0 @@ -../vendor/phpunit/phpunit/phpunit \ No newline at end of file diff --git a/composer.json b/composer.json index c4edd3c2..90f3fd1d 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "ext-iconv": "*", "ext-tokenizer": "*", "ext-pdo": "*", - "symfony/symfony": "3.0.*", + "symfony/symfony": "3.1.*", "doctrine/orm": "^2.5", "doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-cache-bundle": "^1.2", @@ -87,7 +87,7 @@ "doctrine/doctrine-fixtures-bundle": "~2.2", "sensio/generator-bundle": "^3.0", "phpunit/phpunit": "~4.4", - "symfony/phpunit-bridge": "^2.7", + "symfony/phpunit-bridge": "^3.0", "friendsofphp/php-cs-fixer": "~1.9" }, "scripts": { @@ -121,6 +121,9 @@ "psr-4": { "Wallabag\\": "src/Wallabag/" }, "classmap": [ "app/AppKernel.php", "app/AppCache.php" ] }, + "autoload-dev": { + "psr-4": { "Tests\\": "tests/" } + }, "config": { "bin-dir": "bin" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e68df9de..38880908 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,24 +1,20 @@ - +> - src/Wallabag/*Bundle/Tests + tests + diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 4cf22200..74c53bf0 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -32,7 +32,6 @@ class ConfigType extends AbstractType $builder ->add('theme', ChoiceType::class, [ 'choices' => array_flip($this->themes), - 'choices_as_values' => true, 'label' => 'config.form_settings.theme_label', ]) ->add('items_per_page', null, [ @@ -49,7 +48,6 @@ class ConfigType extends AbstractType ]) ->add('language', ChoiceType::class, [ 'choices' => array_flip($this->languages), - 'choices_as_values' => true, 'label' => 'config.form_settings.language_label', ]) ->add('save', SubmitType::class, [ diff --git a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php index f3f848e9..bc59c9a1 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php @@ -113,7 +113,6 @@ class EntryFilterType extends AbstractType ]) ->add('language', ChoiceFilterType::class, [ 'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())), - 'choices_as_values' => true, 'label' => 'entry.filters.language_label', ]) ; diff --git a/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php similarity index 97% rename from src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php rename to tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php index 3eba7193..70849f74 100644 --- a/src/Wallabag/AnnotationBundle/Tests/Controller/AnnotationControllerTest.php +++ b/tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php @@ -1,8 +1,8 @@ unregister(); -$apcLoader->register(true); -*/ - $kernel = new AppKernel('prod', false); $kernel->loadClassCache(); //$kernel = new AppCache($kernel); -- 2.41.0