From 34a343c6c0e6aea02c22a59274aebfcad31f7a67 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Tue, 29 Jan 2019 06:29:24 +0100 Subject: [PATCH 01/27] DevKit updates --- .travis.yml | 11 +++++------ README.md | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b236f0b..b1f512c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,18 +28,17 @@ cache: env: matrix: SYMFONY_VERSION=4.0.* global: - - SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" + - SYMFONY_DEPRECATIONS_HELPER="weak" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - KERNEL_CLASS=Symfony\Cmf\Bundle\SeoBundle\Tests\Fixtures\App\Kernel - SYMFONY_PHPUNIT_VERSION=5.7.26 - - TEST_INSTALLATION=false matrix: include: - - php: 7.3 - env: SYMFONY_VERSION=4.0.* - - php: 7.2 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=weak + - php: "7.3" + env: SYMFONY_VERSION="4.0.*" + - php: "7.2" + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION="3.4.*" SYMFONY_DEPRECATIONS_HELPER="weak" fast_finish: true allow_failures: diff --git a/README.md b/README.md index 68196bd3..69b7e842 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,11 @@ Branch | Travis | Coveralls | Scrutinizer | ------ | ------ | --------- | ----------- | -2.x | [![Build Status][travis_stable_badge]][travis_stable_link] | [![Coverage Status][coveralls_stable_badge]][coveralls_stable_link] | [![Scrutinizer Status][scrutinizer_stable_badge]][scrutinizer_stable_link] | +3.0-dev | [![Build Status][travis_stable_badge]][travis_stable_link] | [![Coverage Status][coveralls_stable_badge]][coveralls_stable_link] | [![Scrutinizer Status][scrutinizer_stable_badge]][scrutinizer_stable_link] | 3.0-dev | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] | [![Scrutinizer Status][scrutinizer_unstable_badge]][scrutinizer_unstable_link] | -This package is part of the [Symfony Content Management Framework (CMF)](http://cmf.symfony.com/) and licensed +This package is part of the [Symfony Content Management Framework (CMF)](https://cmf.symfony.com/) and licensed under the [MIT License](LICENSE). It provides a solution to make content bundles @@ -31,16 +31,16 @@ aware for Search Engine Optimisation (SEO). For the install guide and reference, see: -* [symfony-cmf/seo-bundle Documentation](http://symfony.com/doc/master/cmf/bundles/seo/index.html) +* [symfony-cmf/seo-bundle Documentation](https://symfony.com/doc/master/cmf/bundles/seo/index.html) See also: -* [All Symfony CMF documentation](http://symfony.com/doc/master/cmf/index.html) - complete Symfony CMF reference -* [Symfony CMF Website](http://cmf.symfony.com/) - introduction, live demo, support and community links +* [All Symfony CMF documentation](https://symfony.com/doc/master/cmf/index.html) - complete Symfony CMF reference +* [Symfony CMF Website](https://cmf.symfony.com/) - introduction, live demo, support and community links ## Support -For general support and questions, please use [StackOverflow](http://stackoverflow.com/questions/tagged/symfony-cmf). +For general support and questions, please use [StackOverflow](https://stackoverflow.com/questions/tagged/symfony-cmf). ## Contributing @@ -49,7 +49,7 @@ Pull requests are welcome. Please see our guide. Unit and/or functional tests exist for this package. See the -[Testing documentation](http://symfony.com/doc/master/cmf/components/testing.html) +[Testing documentation](https://symfony.com/doc/master/cmf/components/testing.html) for a guide to running the tests. Thanks to @@ -59,17 +59,17 @@ Thanks to This package is available under the [MIT license](src/Resources/meta/LICENSE). -[travis_stable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=2.x +[travis_stable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=3.0-dev [travis_stable_link]: https://travis-ci.org/symfony-cmf/seo-bundle [travis_unstable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=3.0-dev [travis_unstable_link]: https://travis-ci.org/symfony-cmf/seo-bundle -[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=2.x -[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=2.x +[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=3.0-dev +[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=3.0-dev [coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=3.0-dev [coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=3.0-dev -[scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=2.x -[scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=2.x +[scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=3.0-dev +[scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=3.0-dev [scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=3.0-dev [scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=3.0-dev From ffa449357f9e2e5362b5e8a5c32ebb7740da7814 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Tue, 29 Jan 2019 06:52:35 +0100 Subject: [PATCH 02/27] DevKit updates --- .travis.yml | 8 ++++++-- README.md | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1f512c5..d8374d20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ cache: - $HOME/.composer/cache/files env: - matrix: SYMFONY_VERSION=4.0.* + matrix: SYMFONY_VERSION=4.2.* global: - SYMFONY_DEPRECATIONS_HELPER="weak" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" @@ -36,9 +36,13 @@ env: matrix: include: - php: "7.3" - env: SYMFONY_VERSION="4.0.*" + env: SYMFONY_VERSION="4.2.*" - php: "7.2" env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION="3.4.*" SYMFONY_DEPRECATIONS_HELPER="weak" + - php: "7.3" + env: SYMFONY_VERSION="4.0.*" + - php: "7.3" + env: SYMFONY_VERSION="4.1.*" fast_finish: true allow_failures: diff --git a/README.md b/README.md index 69b7e842..5eb282f7 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ aware for Search Engine Optimisation (SEO). ## Requirements * PHP 7.2 / 7.3 -* Symfony 3.4 / 4.0 +* Symfony 3.4 / 4.0 / 4.1 / 4.2 * See also the `require` section of [composer.json](composer.json) ## Documentation From 512d0cfe639ab7953a48d5a6c39af640829ffb0e Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Wed, 30 Jan 2019 22:53:50 +0100 Subject: [PATCH 03/27] DevKit updates --- .travis.yml | 31 +++++++++++++++++++------------ Makefile | 5 +++-- README.md | 26 +++++++++++++------------- composer.json | 4 ++-- 4 files changed, 37 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index d8374d20..f36898f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,8 @@ language: php php: - 7.1 - + - 7.2 + - 7.3 sudo: false cache: @@ -28,23 +29,29 @@ cache: env: matrix: SYMFONY_VERSION=4.2.* global: - - SYMFONY_DEPRECATIONS_HELPER="weak" + - SYMFONY_DEPRECATIONS_HELPER=weak - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - - KERNEL_CLASS=Symfony\Cmf\Bundle\SeoBundle\Tests\Fixtures\App\Kernel - - SYMFONY_PHPUNIT_VERSION=5.7.26 + - SYMFONY_PHPUNIT_VERSION=7 + - TEST_INSTALLATION=false matrix: include: - - php: "7.3" - env: SYMFONY_VERSION="4.2.*" - - php: "7.2" - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION="3.4.*" SYMFONY_DEPRECATIONS_HELPER="weak" - - php: "7.3" - env: SYMFONY_VERSION="4.0.*" - - php: "7.3" - env: SYMFONY_VERSION="4.1.*" + - php: 7.3 + env: STABILITY="dev" SYMFONY_VERSION=4.3.* + - php: 7.3 + env: SYMFONY_VERSION=4.2.* + - php: 7.1 + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=weak + - php: 7.2 + env: SYMFONY_VERSION=4.0.* + - php: 7.2 + env: SYMFONY_VERSION=4.1.* + - env: TEST_INSTALLATION=true fast_finish: true allow_failures: + - php: 7.3 + env: STABILITY="dev" SYMFONY_VERSION=4.3.* + - env: TEST_INSTALLATION=true before_install: - phpenv config-rm xdebug.ini || true diff --git a/Makefile b/Makefile index fc7d99ce..a5caded6 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,17 @@ ifdef BRANCH VERSION=dev-${BRANCH} endif PACKAGE=symfony-cmf/seo-bundle -export KERNEL_CLASS=Symfony\Cmf\Bundle\SeoBundle\Tests\Fixtures\App\Kernel + list: @echo 'test: will run all tests' @echo 'unit_tests: will run unit tests only' @echo 'functional_tests_phpcr: will run functional tests with PHPCR' @echo 'functional_tests_orm: will run functional tests with ORM' - + @echo 'test_installation: will run installation test' include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk include ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk include ${TESTING_SCRIPTS_DIR}/make/functional_tests_orm.mk +include ${TESTING_SCRIPTS_DIR}/make/test_installation.mk .PHONY: test test: unit_tests functional_tests_phpcr functional_tests_orm diff --git a/README.md b/README.md index 5eb282f7..e812250c 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Branch | Travis | Coveralls | Scrutinizer | ------ | ------ | --------- | ----------- | -3.0-dev | [![Build Status][travis_stable_badge]][travis_stable_link] | [![Coverage Status][coveralls_stable_badge]][coveralls_stable_link] | [![Scrutinizer Status][scrutinizer_stable_badge]][scrutinizer_stable_link] | -3.0-dev | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] | [![Scrutinizer Status][scrutinizer_unstable_badge]][scrutinizer_unstable_link] | +2.1 | [![Build Status][travis_stable_badge]][travis_stable_link] | [![Coverage Status][coveralls_stable_badge]][coveralls_stable_link] | [![Scrutinizer Status][scrutinizer_stable_badge]][scrutinizer_stable_link] | +dev-master | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] | [![Scrutinizer Status][scrutinizer_unstable_badge]][scrutinizer_unstable_link] | This package is part of the [Symfony Content Management Framework (CMF)](https://cmf.symfony.com/) and licensed @@ -23,7 +23,7 @@ aware for Search Engine Optimisation (SEO). ## Requirements -* PHP 7.2 / 7.3 +* PHP 7.1 / 7.2 / 7.3 * Symfony 3.4 / 4.0 / 4.1 / 4.2 * See also the `require` section of [composer.json](composer.json) @@ -59,17 +59,17 @@ Thanks to This package is available under the [MIT license](src/Resources/meta/LICENSE). -[travis_stable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=3.0-dev +[travis_stable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=2.1 [travis_stable_link]: https://travis-ci.org/symfony-cmf/seo-bundle -[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=3.0-dev +[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/seo-bundle.svg?branch=dev-master [travis_unstable_link]: https://travis-ci.org/symfony-cmf/seo-bundle -[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=3.0-dev -[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=3.0-dev -[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=3.0-dev -[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=3.0-dev +[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=2.1 +[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=2.1 +[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/seo-bundle/badge.svg?branch=dev-master +[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/seo-bundle?branch=dev-master -[scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=3.0-dev -[scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=3.0-dev -[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=3.0-dev -[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=3.0-dev +[scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=2.1 +[scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=2.1 +[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/badges/quality-score.png?b=dev-master +[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/seo-bundle/?branch=dev-master diff --git a/composer.json b/composer.json index 71333a61..c2252e8e 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.1", "symfony/framework-bundle": "^3.4 || ^4.0", "sonata-project/seo-bundle": "^2.2", "doctrine/collections": "^1.0" @@ -27,7 +27,7 @@ "symfony-cmf/routing-bundle": "^1.4.0 || ^2.1", "matthiasnoback/symfony-dependency-injection-test": "^1.1", "matthiasnoback/symfony-config-test": "^2.1", - "symfony/phpunit-bridge": "^3.4 || ^4.0", + "symfony/phpunit-bridge": "^4.2.2", "burgov/key-value-form-bundle": "^1.0", "symfony-cmf/testing": "^2.1.9", "symfony/security-bundle": "^3.4 || ^4.0", From 8a9f4c85ba802ad0d84b5ef3702e30924d84432c Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Wed, 30 Jan 2019 23:41:54 +0100 Subject: [PATCH 04/27] DevKit updates --- .travis.yml | 2 +- Makefile | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f36898f0..1f87edd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ env: global: - SYMFONY_DEPRECATIONS_HELPER=weak - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - - SYMFONY_PHPUNIT_VERSION=7 + - SYMFONY_PHPUNIT_VERSION=6 - TEST_INSTALLATION=false matrix: diff --git a/Makefile b/Makefile index a5caded6..16893906 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,12 @@ ############################################################################ TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin + +SYMFONY_PHPUNIT_VERSION=6 +SYMFONY_DEPRECATIONS_HELPER==weak CONSOLE=${TESTING_SCRIPTS_DIR}/console +SYMFONY_PHPUNIT_DIR=.phpunit +SYMFONY_PHPUNIT_REMOVE="symfony/yaml" VERSION=dev-master ifdef BRANCH VERSION=dev-${BRANCH} From 718e9e6d853fb563a269b4b79b55effb427071fd Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Thu, 31 Jan 2019 01:05:20 +0100 Subject: [PATCH 05/27] first steps into phpunit 6 usage --- composer.json | 4 ++-- phpunit.xml.dist | 4 ++++ src/DependencyInjection/Configuration.php | 4 ++-- tests/Unit/Cache/FileCacheTest.php | 3 ++- tests/Unit/Controller/SitemapControllerTest.php | 3 ++- tests/Unit/DependencyInjection/ConfigValuesTest.php | 3 ++- tests/Unit/EventListener/ContentListenerTest.php | 3 ++- tests/Unit/EventListener/LanguageListenerTest.php | 3 ++- tests/Unit/Extractor/BaseTestCase.php | 3 ++- tests/Unit/Matcher/ExclusionMatcherTest.php | 3 ++- tests/Unit/Model/UrlInformationTest.php | 3 ++- tests/Unit/SeoPresentationTest.php | 3 ++- tests/Unit/Sitemap/AbstractChainTest.php | 3 ++- tests/Unit/Sitemap/GuesserTestCase.php | 3 ++- tests/Unit/Sitemap/SitemapAwareDocumentVoterTest.php | 3 ++- tests/Unit/Sitemap/UrlInformationProviderTest.php | 3 ++- 16 files changed, 34 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index c2252e8e..e7565929 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "doctrine/orm": "^2.4", "symfony-cmf/core-bundle": "^2.1", "symfony-cmf/routing-bundle": "^1.4.0 || ^2.1", - "matthiasnoback/symfony-dependency-injection-test": "^1.1", - "matthiasnoback/symfony-config-test": "^2.1", + "matthiasnoback/symfony-dependency-injection-test": "^2.3.1", + "matthiasnoback/symfony-config-test": "^3.1.1", "symfony/phpunit-bridge": "^4.2.2", "burgov/key-value-form-bundle": "^1.0", "symfony-cmf/testing": "^2.1.9", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f1716d6c..04ad3265 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -19,6 +19,10 @@ + + + + . diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index cf6f969d..60c2697a 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -30,9 +30,9 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); + $treeBuilder = new TreeBuilder('cmf_seo'); - $nodeBuilder = $treeBuilder->root('cmf_seo') + $nodeBuilder = $treeBuilder->getRootNode() ->addDefaultsIfNotSet() ->beforeNormalization() ->ifTrue(function ($config) { diff --git a/tests/Unit/Cache/FileCacheTest.php b/tests/Unit/Cache/FileCacheTest.php index fa3fa9d2..bdf1dd28 100644 --- a/tests/Unit/Cache/FileCacheTest.php +++ b/tests/Unit/Cache/FileCacheTest.php @@ -9,12 +9,13 @@ * file that was distributed with this source code. */ +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Cache\FileCache; /** * @author Maximilian Berghoff */ -class FileCacheTest extends \PHPUnit_Framework_TestCase +class FileCacheTest extends TestCase { public function testThrowingExceptionForUnknownBaseDir() { diff --git a/tests/Unit/Controller/SitemapControllerTest.php b/tests/Unit/Controller/SitemapControllerTest.php index 3356892f..8f15e757 100644 --- a/tests/Unit/Controller/SitemapControllerTest.php +++ b/tests/Unit/Controller/SitemapControllerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Controller; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Controller\SitemapController; use Symfony\Cmf\Bundle\SeoBundle\Model\AlternateLocale; use Symfony\Cmf\Bundle\SeoBundle\Model\UrlInformation; @@ -21,7 +22,7 @@ /** * @author Maximilian Berghoff */ -class SitemapControllerTest extends \PHPUnit_Framework_TestCase +class SitemapControllerTest extends TestCase { /** * @var EngineInterface diff --git a/tests/Unit/DependencyInjection/ConfigValuesTest.php b/tests/Unit/DependencyInjection/ConfigValuesTest.php index 57d5baad..7a771836 100644 --- a/tests/Unit/DependencyInjection/ConfigValuesTest.php +++ b/tests/Unit/DependencyInjection/ConfigValuesTest.php @@ -11,9 +11,10 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\DependencyInjection; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\DependencyInjection\ConfigValues; -class ConfigValuesTest extends \PHPUnit_Framework_Testcase +class ConfigValuesTest extends TestCase { /** * @expectedException \Symfony\Cmf\Bundle\SeoBundle\Exception\ExtractorStrategyException diff --git a/tests/Unit/EventListener/ContentListenerTest.php b/tests/Unit/EventListener/ContentListenerTest.php index e803db55..e7d492bd 100644 --- a/tests/Unit/EventListener/ContentListenerTest.php +++ b/tests/Unit/EventListener/ContentListenerTest.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\EventListener; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter; use Symfony\Cmf\Bundle\SeoBundle\EventListener\ContentListener; use Symfony\Cmf\Bundle\SeoBundle\SeoPresentationInterface; @@ -19,7 +20,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -class ContentListenerTest extends \PHPUnit_Framework_Testcase +class ContentListenerTest extends TestCase { protected $seoPresentation; diff --git a/tests/Unit/EventListener/LanguageListenerTest.php b/tests/Unit/EventListener/LanguageListenerTest.php index 6efd67b6..43089c6e 100644 --- a/tests/Unit/EventListener/LanguageListenerTest.php +++ b/tests/Unit/EventListener/LanguageListenerTest.php @@ -11,12 +11,13 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\EventListener; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\EventListener\LanguageListener; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\FilterResponseEvent; -class LanguageListenerTest extends \PHPUnit_Framework_Testcase +class LanguageListenerTest extends TestCase { private $listener; diff --git a/tests/Unit/Extractor/BaseTestCase.php b/tests/Unit/Extractor/BaseTestCase.php index 9990f984..1f99e45c 100644 --- a/tests/Unit/Extractor/BaseTestCase.php +++ b/tests/Unit/Extractor/BaseTestCase.php @@ -11,9 +11,10 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Extractor; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Model\SeoMetadataInterface; -abstract class BaseTestCase extends \PHPUnit_Framework_TestCase +abstract class BaseTestCase extends TestCase { protected $seoMetadata; diff --git a/tests/Unit/Matcher/ExclusionMatcherTest.php b/tests/Unit/Matcher/ExclusionMatcherTest.php index d4407f66..5dccbfb0 100644 --- a/tests/Unit/Matcher/ExclusionMatcherTest.php +++ b/tests/Unit/Matcher/ExclusionMatcherTest.php @@ -9,6 +9,7 @@ * file that was distributed with this source code. */ +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Matcher\ExclusionMatcher; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestMatcherInterface; @@ -16,7 +17,7 @@ /** * @author Maximilian Berghoff */ -class ExclusionMatcherTest extends PHPUnit_Framework_TestCase +class ExclusionMatcherTest extends TestCase { /** * @var RequestMatcherInterface diff --git a/tests/Unit/Model/UrlInformationTest.php b/tests/Unit/Model/UrlInformationTest.php index b14f7832..b60a610f 100644 --- a/tests/Unit/Model/UrlInformationTest.php +++ b/tests/Unit/Model/UrlInformationTest.php @@ -11,12 +11,13 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Model; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Model\UrlInformation; /** * @author Maximilian Berghoff */ -class UrlInformationTest extends \PHPUnit_Framework_Testcase +class UrlInformationTest extends TestCase { /** * @var UrlInformation diff --git a/tests/Unit/SeoPresentationTest.php b/tests/Unit/SeoPresentationTest.php index 99b8cc1e..5ee3115d 100644 --- a/tests/Unit/SeoPresentationTest.php +++ b/tests/Unit/SeoPresentationTest.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit; +use PHPUnit\Framework\TestCase; use Sonata\SeoBundle\Seo\SeoPage; use Symfony\Cmf\Bundle\SeoBundle\Cache\CacheInterface; use Symfony\Cmf\Bundle\SeoBundle\Cache\ExtractorCollection; @@ -26,7 +27,7 @@ * This model is responsible for putting the SeoMetadata into * sonatas PageService. */ -class SeoPresentationTest extends \PHPUnit_Framework_Testcase +class SeoPresentationTest extends TestCase { private $seoPresentation; diff --git a/tests/Unit/Sitemap/AbstractChainTest.php b/tests/Unit/Sitemap/AbstractChainTest.php index 7a4038f0..a7e8c799 100644 --- a/tests/Unit/Sitemap/AbstractChainTest.php +++ b/tests/Unit/Sitemap/AbstractChainTest.php @@ -11,12 +11,13 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Sitemap; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\AbstractChain; /** * @author Maximilian Berghoff */ -class AbstractChainTest extends \PHPUnit_Framework_Testcase +class AbstractChainTest extends TestCase { /** @var TestChain */ private $chain; diff --git a/tests/Unit/Sitemap/GuesserTestCase.php b/tests/Unit/Sitemap/GuesserTestCase.php index d6b87075..51e824f6 100644 --- a/tests/Unit/Sitemap/GuesserTestCase.php +++ b/tests/Unit/Sitemap/GuesserTestCase.php @@ -11,13 +11,14 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Sitemap; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Model\UrlInformation; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\GuesserInterface; /** * Test a guesser. */ -abstract class GuesserTestCase extends \PHPUnit_Framework_Testcase +abstract class GuesserTestCase extends TestCase { /** * @var GuesserInterface diff --git a/tests/Unit/Sitemap/SitemapAwareDocumentVoterTest.php b/tests/Unit/Sitemap/SitemapAwareDocumentVoterTest.php index 921c98ae..a50bc6ea 100644 --- a/tests/Unit/Sitemap/SitemapAwareDocumentVoterTest.php +++ b/tests/Unit/Sitemap/SitemapAwareDocumentVoterTest.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Sitemap; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\SitemapAwareDocumentVoter; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\VoterInterface; use Symfony\Cmf\Bundle\SeoBundle\SitemapAwareInterface; @@ -18,7 +19,7 @@ /** * @author Maximilian Berghoff */ -class SitemapAwareDocumentVoterTest extends \PHPUnit_Framework_TestCase +class SitemapAwareDocumentVoterTest extends TestCase { /** * @var VoterInterface diff --git a/tests/Unit/Sitemap/UrlInformationProviderTest.php b/tests/Unit/Sitemap/UrlInformationProviderTest.php index 8a050fe4..00d43571 100644 --- a/tests/Unit/Sitemap/UrlInformationProviderTest.php +++ b/tests/Unit/Sitemap/UrlInformationProviderTest.php @@ -11,6 +11,7 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Unit\Sitemap; +use PHPUnit\Framework\TestCase; use Symfony\Cmf\Bundle\SeoBundle\Model\UrlInformation; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\GuesserChain; use Symfony\Cmf\Bundle\SeoBundle\Sitemap\LoaderChain; @@ -20,7 +21,7 @@ /** * @author Maximilian Berghoff */ -class UrlInformationProviderTest extends \PHPUnit_Framework_Testcase +class UrlInformationProviderTest extends TestCase { /** * @var UrlInformationProvider From 561a003dba9668715835bd136a420092469a6300 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Mon, 4 Feb 2019 09:16:36 +0100 Subject: [PATCH 06/27] DevKit updates --- .travis.yml | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f87edd7..ebb0f6f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ cache: env: matrix: SYMFONY_VERSION=4.2.* global: - - SYMFONY_DEPRECATIONS_HELPER=weak + - SYMFONY_DEPRECATIONS_HELPER=/.*each.*/ - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - SYMFONY_PHPUNIT_VERSION=6 - TEST_INSTALLATION=false @@ -41,7 +41,7 @@ matrix: - php: 7.3 env: SYMFONY_VERSION=4.2.* - php: 7.1 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=weak + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=/.*each.*/ - php: 7.2 env: SYMFONY_VERSION=4.0.* - php: 7.2 diff --git a/Makefile b/Makefile index 16893906..957ae847 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin SYMFONY_PHPUNIT_VERSION=6 -SYMFONY_DEPRECATIONS_HELPER==weak +SYMFONY_DEPRECATIONS_HELPER==/.*each.*/ CONSOLE=${TESTING_SCRIPTS_DIR}/console SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" From 38246f1c56ba6993915d8d967dfe305ab485e940 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Mon, 4 Feb 2019 09:33:23 +0100 Subject: [PATCH 07/27] root node defintion for SF < 4.2 also --- src/DependencyInjection/Configuration.php | 9 ++++++++- tests/Fixtures/App/Controller/TestController.php | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 60c2697a..a5a01143 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -31,8 +31,15 @@ class Configuration implements ConfigurationInterface public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('cmf_seo'); + // Keep compatibility with symfony/config < 4.2 + if (!method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->root('cmf_seo'); + } else { + $rootNode = $treeBuilder->getRootNode(); + } - $nodeBuilder = $treeBuilder->getRootNode() + + $rootNode ->addDefaultsIfNotSet() ->beforeNormalization() ->ifTrue(function ($config) { diff --git a/tests/Fixtures/App/Controller/TestController.php b/tests/Fixtures/App/Controller/TestController.php index 6566c1d2..777d3679 100644 --- a/tests/Fixtures/App/Controller/TestController.php +++ b/tests/Fixtures/App/Controller/TestController.php @@ -11,9 +11,9 @@ namespace Symfony\Cmf\Bundle\SeoBundle\Tests\Fixtures\App\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -class TestController extends Controller +class TestController extends AbstractController { public function indexAction($contentDocument) { From eca857c7303eed7f9669c8a65822049b36d91269 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Mon, 4 Feb 2019 09:47:20 +0100 Subject: [PATCH 08/27] replace former variable --- src/DependencyInjection/Configuration.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index a5a01143..b5621c0e 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -90,14 +90,14 @@ public function getConfigTreeBuilder() ->scalarNode('original_route_pattern')->defaultValue(SeoPresentation::ORIGINAL_URL_CANONICAL)->end() ; - $this->addPersistenceSection($nodeBuilder); - $this->addAlternateLocaleSection($nodeBuilder); - $this->addErrorHandlerSection($nodeBuilder); - $this->addSitemapSection($nodeBuilder); - $this->addContentListenerSection($nodeBuilder); - $this->addFormSection($nodeBuilder); + $this->addPersistenceSection($rootNode); + $this->addAlternateLocaleSection($rootNode); + $this->addErrorHandlerSection($rootNode); + $this->addSitemapSection($rootNode); + $this->addContentListenerSection($rootNode); + $this->addFormSection($rootNode); - $nodeBuilder->end(); + $rootNode->end(); return $treeBuilder; } From 3f8c1ecce99844a3faf3b17e2f3127e477001d5f Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Mon, 4 Feb 2019 09:56:34 +0100 Subject: [PATCH 09/27] DevKit updates --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebb0f6f2..db5c9191 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ cache: env: matrix: SYMFONY_VERSION=4.2.* global: - - SYMFONY_DEPRECATIONS_HELPER=/.*each.*/ + - SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - SYMFONY_PHPUNIT_VERSION=6 - TEST_INSTALLATION=false @@ -41,7 +41,8 @@ matrix: - php: 7.3 env: SYMFONY_VERSION=4.2.* - php: 7.1 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER=/.*each.*/ + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" + - php: 7.2 env: SYMFONY_VERSION=4.0.* - php: 7.2 From 662db7d15492194061720c630ebf62fa8f611480 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 8 Feb 2019 06:20:21 +0100 Subject: [PATCH 10/27] DevKit updates --- .php_cs | 3 +++ Makefile | 23 ++++++++++++----- php_cs.dist | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ phpunit.xml.dist | 52 +++++++++++++++++-------------------- 4 files changed, 111 insertions(+), 34 deletions(-) create mode 100644 .php_cs create mode 100644 php_cs.dist diff --git a/.php_cs b/.php_cs new file mode 100644 index 00000000..97adafa4 --- /dev/null +++ b/.php_cs @@ -0,0 +1,3 @@ + true, + '@Symfony:risky' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'header_comment' => [ + 'header' => $header, + ], + 'no_extra_blank_lines' => true, + 'no_php4_constructor' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + '@PHP56Migration' => true, + '@PHP56Migration:risky' => true, + '@PHPUnit57Migration:risky' => true, + '@PHP70Migration' => true, + '@PHP70Migration:risky' => true, + '@PHPUnit60Migration:risky' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, + 'compact_nullable_typehint' => true, + 'void_return' => null, + 'strict_comparison' => true, + 'strict_param' => true, + 'php_unit_strict' => true, +]; + + +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__) + ->exclude('Tests/Fixtures') + ->exclude('tests/Fixtures') + ->exclude('Resources/skeleton') + ->exclude('Resources/public/vendor') +; + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRiskyAllowed(true) + ->setRules($rules) + ->setUsingCache(true) +; diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 04ad3265..6567c49f 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,36 +1,32 @@ - - - - ./tests/Unit - + + + + + ./tests/Unit + - ./tests/WebTest - ./tests/Functional/Doctrine/Phpcr - - + ./tests/Functional + ./tests/Functional/Doctrine/Orm + - ./tests/Functional/Doctrine/Orm - - + ./tests/Functional/Doctrine/Orm + - - - + + + src/ + + Resources/ + + + - - - . - - Resources/ - tests - vendor/ - - - + + From 4389d89ea9b78a698512f82c34b5080040401b08 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 8 Feb 2019 06:20:55 +0100 Subject: [PATCH 11/27] DevKit updates --- phpunit.xml.dist | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6567c49f..39fdd77c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,15 +8,15 @@ - ./tests/Unit - + ./tests/Unit + - ./tests/Functional - ./tests/Functional/Doctrine/Orm - + ./tests/Functional + ./tests/Functional/Doctrine/Orm + - ./tests/Functional/Doctrine/Orm - + ./tests/Functional/Doctrine/Orm + @@ -28,5 +28,5 @@ - + From 215eb71d5189e9c4a42aff9c0677efd9d122d13f Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 8 Feb 2019 06:21:34 +0100 Subject: [PATCH 12/27] DevKit updates --- phpunit.xml.dist | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 39fdd77c..6b2d1c16 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,15 +8,15 @@ - ./tests/Unit - + ./tests/Unit + - ./tests/Functional - ./tests/Functional/Doctrine/Orm - + ./tests/Functional + ./tests/Functional/Doctrine/Orm + - ./tests/Functional/Doctrine/Orm - + ./tests/Functional/Doctrine/Orm + From 32986aaf604aec9c55ef9d971062cd6ed54fe766 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 8 Feb 2019 06:24:42 +0100 Subject: [PATCH 13/27] DevKit updates --- phpunit.xml.dist | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6b2d1c16..f36e8e35 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,16 +7,23 @@ > + ./tests/Unit + + ./tests/Functional ./tests/Functional/Doctrine/Orm + + ./tests/Functional/Doctrine/Orm - + + + @@ -28,5 +35,7 @@ - + + + From 926448d00c3eb61fee97fbf52b2f332bd72b3ec3 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Thu, 14 Feb 2019 08:06:20 +0100 Subject: [PATCH 14/27] DevKit updates --- .php_cs.dist | 64 +++++++++++++++++++++++++++++++++++ .travis.yml | 20 ++++++----- .travis/after_success_test.sh | 5 +++ .travis/install_lint.sh | 11 ++++++ .travis/install_test.sh | 19 +++++++++++ Makefile | 53 +++++++++++++++++++++++++---- README.md | 2 +- composer.json | 16 ++++----- phpunit.xml.dist | 7 ++-- 9 files changed, 169 insertions(+), 28 deletions(-) create mode 100644 .php_cs.dist create mode 100755 .travis/after_success_test.sh create mode 100755 .travis/install_lint.sh create mode 100755 .travis/install_test.sh diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 00000000..5759af56 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,64 @@ + true, + '@Symfony:risky' => true, + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'header_comment' => [ + 'header' => $header, + ], + 'no_extra_blank_lines' => true, + 'no_php4_constructor' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'phpdoc_order' => true, + '@PHP56Migration' => true, + '@PHP56Migration:risky' => true, + '@PHPUnit57Migration:risky' => true, + '@PHP70Migration' => true, + '@PHP70Migration:risky' => true, + '@PHPUnit60Migration:risky' => true, + '@PHP71Migration' => true, + '@PHP71Migration:risky' => true, + 'compact_nullable_typehint' => true, + 'void_return' => null, + 'strict_comparison' => true, + 'strict_param' => true, +]; + + +$finder = PhpCsFixer\Finder::create() + ->in(__DIR__) + ->exclude('Tests/Fixtures') + ->exclude('tests/Fixtures') + ->exclude('Resources/skeleton') + ->exclude('Resources/public/vendor') +; + +return PhpCsFixer\Config::create() + ->setFinder($finder) + ->setRiskyAllowed(true) + ->setRules($rules) + ->setUsingCache(true) +; diff --git a/.travis.yml b/.travis.yml index db5c9191..7c693236 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,10 +32,12 @@ env: - SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - SYMFONY_PHPUNIT_VERSION=6 - - TEST_INSTALLATION=false + - PHPUNIT_VERSION=6 + - TARGET=test matrix: include: + - env: TARGET=lint - php: 7.3 env: STABILITY="dev" SYMFONY_VERSION=4.3.* - php: 7.3 @@ -43,16 +45,14 @@ matrix: - php: 7.1 env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" - - php: 7.2 - env: SYMFONY_VERSION=4.0.* - php: 7.2 env: SYMFONY_VERSION=4.1.* - - env: TEST_INSTALLATION=true + - env: TARGET=test_installation fast_finish: true allow_failures: - php: 7.3 env: STABILITY="dev" SYMFONY_VERSION=4.3.* - - env: TEST_INSTALLATION=true + - env: TARGET=test_installation before_install: - phpenv config-rm xdebug.ini || true @@ -62,9 +62,13 @@ before_install: - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) -install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS -script: - - if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi +install: + - if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi; + +script: make $TARGET + +after_success: + - if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; notifications: irc: "irc.freenode.org#symfony-cmf" diff --git a/.travis/after_success_test.sh b/.travis/after_success_test.sh new file mode 100755 index 00000000..98374202 --- /dev/null +++ b/.travis/after_success_test.sh @@ -0,0 +1,5 @@ + +#!/usr/bin/env sh +set -ev + +coveralls -v diff --git a/.travis/install_lint.sh b/.travis/install_lint.sh new file mode 100755 index 00000000..864c751e --- /dev/null +++ b/.travis/install_lint.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh +set -ev + +mkdir --parents "${HOME}/bin" + +wget "http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar" --output-document="${HOME}/bin/php-cs-fixer" +chmod u+x "${HOME}/bin/php-cs-fixer" + +composer global require sllh/composer-lint:@stable --prefer-dist --no-interaction + +gem install yaml-lint diff --git a/.travis/install_test.sh b/.travis/install_test.sh new file mode 100755 index 00000000..a0335009 --- /dev/null +++ b/.travis/install_test.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env sh +set -ev + +mkdir --parents "${HOME}/bin" + +wget "https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar" --output-document="${HOME}/bin/phpunit" +chmod u+x "${HOME}/bin/phpunit" + +# Coveralls client install +wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls" +chmod u+x "${HOME}/bin/coveralls" + +# To be removed when these issues are resolved: +# https://github.com/composer/composer/issues/5355 +if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then + composer update --prefer-dist --no-interaction --prefer-stable --quiet +fi + +composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS} diff --git a/Makefile b/Makefile index 71a41403..30c8cd4e 100644 --- a/Makefile +++ b/Makefile @@ -27,25 +27,64 @@ list: @echo 'unit_tests: will run unit tests only' @echo 'functional_tests_phpcr: will run functional tests with PHPCR' @echo 'functional_tests_orm: will run functional tests with ORM' - @echo 'test_installation: will run installation test' -include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk -include ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk -include ${TESTING_SCRIPTS_DIR}/make/functional_tests_orm.mk -include ${TESTING_SCRIPTS_DIR}/make/test_installation.mk + @echo 'test_installation: will run installation test'TEST_DEPENDENCIES := "" +EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk) +ifneq ($(strip $(EXTRA_INCLUDES)),) + contents := $(shell echo including extra rules $(EXTRA_INCLUDES)) + include $(EXTRA_INCLUDES) + TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" unit_tests" + endif +EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk) +ifneq ($(strip $(EXTRA_INCLUDES)),) + contents := $(shell echo including extra rules $(EXTRA_INCLUDES)) + include $(EXTRA_INCLUDES) + TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" functional_tests_phpcr" + endif +EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_orm.mk) +ifneq ($(strip $(EXTRA_INCLUDES)),) + contents := $(shell echo including extra rules $(EXTRA_INCLUDES)) + include $(EXTRA_INCLUDES) + TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" functional_tests_orm" + endif +EXTRA_INCLUDES:=$(wildcard ${TESTING_SCRIPTS_DIR}/make/test_installation.mk) +ifneq ($(strip $(EXTRA_INCLUDES)),) + contents := $(shell echo including extra rules $(EXTRA_INCLUDES)) + include $(EXTRA_INCLUDES) + endif .PHONY: test -test: build/xdebug-filter.php unit_tests functional_tests_phpcr functional_tests_orm +test: build/xdebug-filter.php$ +ifneq ($(strip $(wildcard ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk)),) + @make unit_tests +endif +ifneq ($(strip $(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk)),) + @make functional_tests_phpcr +endif +ifneq ($(strip $(wildcard ${TESTING_SCRIPTS_DIR}/make/functional_tests_orm.mk)),) + @make functional_tests_orm +endif + lint-php: php-cs-fixer fix --ansi --verbose --diff --dry-run .PHONY: lint-php -cs-fix: cs-fix-php cs-fix-xml +lint: lint-composer lint-php +.PHONY: lint + +lint-composer: + composer validate +.PHONY: lint-composer + +cs-fix: cs-fix-php .PHONY: cs-fix cs-fix-php: php-cs-fixer fix --verbose .PHONY: cs-fix-php +build: + mkdir $@ + build/xdebug-filter.php: phpunit.xml.dist build ifeq ($(HAS_XDEBUG), 0) phpunit --dump-xdebug-filter $@ diff --git a/README.md b/README.md index e812250c..7c4abc95 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ aware for Search Engine Optimisation (SEO). ## Requirements * PHP 7.1 / 7.2 / 7.3 -* Symfony 3.4 / 4.0 / 4.1 / 4.2 +* Symfony 3.4 / 4.1 / 4.2 * See also the `require` section of [composer.json](composer.json) ## Documentation diff --git a/composer.json b/composer.json index e7565929..6d3f7681 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": "^7.1", - "symfony/framework-bundle": "^3.4 || ^4.0", + "symfony/framework-bundle": "^3.4 || ^4.1", "sonata-project/seo-bundle": "^2.2", "doctrine/collections": "^1.0" }, @@ -30,13 +30,13 @@ "symfony/phpunit-bridge": "^4.2.2", "burgov/key-value-form-bundle": "^1.0", "symfony-cmf/testing": "^2.1.9", - "symfony/security-bundle": "^3.4 || ^4.0", - "symfony/translation": "^3.4 || ^4.0", - "symfony/validator": "^3.4 || ^4.0", - "symfony/asset": "^3.4 || ^4.0", - "symfony/templating": "^3.4 || ^4.0", - "symfony/browser-kit": "^3.4 || ^4.0", - "symfony/css-selector": "^3.4 || ^4.0" + "symfony/security-bundle": "^3.4 || ^4.1", + "symfony/translation": "^3.4 || ^4.1", + "symfony/validator": "^3.4 || ^4.1", + "symfony/asset": "^3.4 || ^4.1", + "symfony/templating": "^3.4 || ^4.1", + "symfony/browser-kit": "^3.4 || ^4.1", + "symfony/css-selector": "^3.4 || ^4.1" }, "suggest": { "symfony-cmf/core-bundle": "When using the provided PHPCR-ODM document", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f36e8e35..2f383d3c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -7,23 +7,22 @@ > + ./tests/Unit - ./tests/Functional ./tests/Functional/Doctrine/Orm - ./tests/Functional/Doctrine/Orm - - + + From 445ff47db5034a0e9ad7c0bed6b8486859f6166a Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Thu, 14 Feb 2019 09:11:48 +0100 Subject: [PATCH 15/27] DevKit updates --- .styleci.yml | 2 +- .travis.yml | 2 +- Makefile | 2 +- src/Resources/meta/LICENSE | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.styleci.yml b/.styleci.yml index 2bdb04b1..c721eb61 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -7,7 +7,7 @@ ############################################################################ # This file is part of the Symfony CMF package. # # # -# (c) 2011-2017 Symfony CMF # +# (c) Symfony CMF # # # # For the full copyright and license information, please view the LICENSE # # file that was distributed with this source code. # diff --git a/.travis.yml b/.travis.yml index 7c693236..bd338d06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ ############################################################################ # This file is part of the Symfony CMF package. # # # -# (c) 2011-2017 Symfony CMF # +# (c) Symfony CMF # # # # For the full copyright and license information, please view the LICENSE # # file that was distributed with this source code. # diff --git a/Makefile b/Makefile index 30c8cd4e..966e9c7f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ############################################################################ # This file is part of the Symfony CMF package. # # # -# (c) 2011-2017 Symfony CMF # +# (c) Symfony CMF # # # # For the full copyright and license information, please view the LICENSE # # file that was distributed with this source code. # diff --git a/src/Resources/meta/LICENSE b/src/Resources/meta/LICENSE index bb288424..4f97a0a1 100644 --- a/src/Resources/meta/LICENSE +++ b/src/Resources/meta/LICENSE @@ -2,7 +2,7 @@ Symfony CMF Seo Bundle The MIT License - Copyright (c) 2011-2017 Symfony CMF + Copyright (c) Symfony CMF Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 50e21d9467ec663f19cc04b31d4bae59728efe30 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Tue, 26 Feb 2019 01:33:55 +0100 Subject: [PATCH 16/27] add changelog entry --- CHANGELOG.md | 5 ++++- src/DependencyInjection/Configuration.php | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4858f45..e9d44443 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,10 @@ Changelog 2.2.0 (unreleased) ------------------ - +* **2015-02-26**:introduce PHPCS for style checks again +* **2015-02-26**: Symfony 4.2 combustibility verified through tests, Symfony 4.3 allowed to break but on watch in tests +* **2015-02-26**: drop Symfony 2.8 support +* **2015-02-26**: make use of PHPUnit 6 2.1.0 ----- diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index b5621c0e..44e1fb2b 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -157,7 +157,7 @@ private function addAlternateLocaleSection(NodeBuilder $nodeBuilder) * * @param NodeBuilder $nodeBuilder */ - private function addErrorHandlerSection(NodeBuilder $nodeBuilder) + private function addErrorHandlerSection(ArrayNodeDefinition $nodeBuilder) { $nodeBuilder ->arrayNode('error') @@ -194,7 +194,7 @@ private function addErrorHandlerSection(NodeBuilder $nodeBuilder) * * @param NodeBuilder $nodeBuilder */ - private function addSitemapSection(NodeBuilder $nodeBuilder) + private function addSitemapSection(ArrayNodeDefinition $nodeBuilder) { $nodeBuilder ->arrayNode('sitemap') @@ -271,7 +271,7 @@ private function getSitemapHelperNode($type, $default) * * @param NodeBuilder $nodeBuilder */ - private function addContentListenerSection(NodeBuilder $nodeBuilder) + private function addContentListenerSection(ArrayNodeDefinition $nodeBuilder) { $nodeBuilder ->arrayNode('content_listener') From c3a11153df6a9d1df0a287529bb0648befa2456d Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Tue, 26 Feb 2019 01:41:11 +0100 Subject: [PATCH 17/27] add changelog entry --- build/xdebug-filter.php | 12 ++++++++++++ composer.json | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 build/xdebug-filter.php diff --git a/build/xdebug-filter.php b/build/xdebug-filter.php new file mode 100644 index 00000000..a778f83a --- /dev/null +++ b/build/xdebug-filter.php @@ -0,0 +1,12 @@ + Date: Tue, 26 Feb 2019 01:43:43 +0100 Subject: [PATCH 18/27] added change to own water --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f283645b..c7730005 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ tests/Fixtures/App/var !tests/Fixtures/App/var/.gitempty +.php_cs composer.lock vendor From 4ddc38eb67673a500315f3be91bd1f4542148530 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Tue, 26 Feb 2019 16:19:38 +0100 Subject: [PATCH 19/27] fix configuration with root node --- src/DependencyInjection/Configuration.php | 250 ++++++++++++---------- 1 file changed, 133 insertions(+), 117 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 44e1fb2b..8c0aa9eb 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -14,7 +14,6 @@ use Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter; use Symfony\Cmf\Bundle\SeoBundle\SeoPresentation; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\NodeBuilder; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -88,6 +87,7 @@ public function getConfigTreeBuilder() ->scalarNode('title')->end() ->scalarNode('description')->end() ->scalarNode('original_route_pattern')->defaultValue(SeoPresentation::ORIGINAL_URL_CANONICAL)->end() + ->end() ; $this->addPersistenceSection($rootNode); @@ -97,36 +97,36 @@ public function getConfigTreeBuilder() $this->addContentListenerSection($rootNode); $this->addFormSection($rootNode); - $rootNode->end(); - return $treeBuilder; } /** * Attach the persistence node to the tree. * - * @param NodeBuilder $treeBuilder + * @param ArrayNodeDefinition $root */ - private function addPersistenceSection(NodeBuilder $treeBuilder) + private function addPersistenceSection(ArrayNodeDefinition $root) { - $treeBuilder - ->arrayNode('persistence') - ->addDefaultsIfNotSet() - ->children() - ->arrayNode('phpcr') - ->addDefaultsIfNotSet() - ->canBeEnabled() - ->children() - ->scalarNode('manager_name')->defaultNull()->end() - ->scalarNode('content_basepath')->defaultValue('/cms/content')->end() + $root + ->children() + ->arrayNode('persistence') + ->addDefaultsIfNotSet() + ->children() + ->arrayNode('phpcr') + ->addDefaultsIfNotSet() + ->canBeEnabled() + ->children() + ->scalarNode('manager_name')->defaultNull()->end() + ->scalarNode('content_basepath')->defaultValue('/cms/content')->end() + ->end() ->end() - ->end() - ->arrayNode('orm') - ->addDefaultsIfNotSet() - ->canBeEnabled() - ->children() - ->scalarNode('manager_name')->defaultNull()->end() + ->arrayNode('orm') + ->addDefaultsIfNotSet() + ->canBeEnabled() + ->children() + ->scalarNode('manager_name')->defaultNull()->end() + ->end() ->end() ->end() ->end() @@ -137,16 +137,18 @@ private function addPersistenceSection(NodeBuilder $treeBuilder) /** * Attach the alternate locale node to the tree. * - * @param NodeBuilder $nodeBuilder + * @param ArrayNodeDefinition $root */ - private function addAlternateLocaleSection(NodeBuilder $nodeBuilder) + private function addAlternateLocaleSection(ArrayNodeDefinition $root) { - $nodeBuilder - ->arrayNode('alternate_locale') - ->addDefaultsIfNotSet() - ->canBeEnabled() - ->children() - ->scalarNode('provider_id')->defaultNull()->end() + $root + ->children() + ->arrayNode('alternate_locale') + ->addDefaultsIfNotSet() + ->canBeEnabled() + ->children() + ->scalarNode('provider_id')->defaultNull()->end() + ->end() ->end() ->end() ; @@ -155,31 +157,33 @@ private function addAlternateLocaleSection(NodeBuilder $nodeBuilder) /** * Attach the error node to the tree. * - * @param NodeBuilder $nodeBuilder + * @param ArrayNodeDefinition $root */ - private function addErrorHandlerSection(ArrayNodeDefinition $nodeBuilder) + private function addErrorHandlerSection(ArrayNodeDefinition $root) { - $nodeBuilder - ->arrayNode('error') - ->fixXmlConfig('template') - ->fixXmlConfig('exclusion_rule') - ->children() - ->booleanNode('enable_parent_provider')->defaultFalse()->end() - ->booleanNode('enable_sibling_provider')->defaultFalse()->end() - ->arrayNode('templates') - ->useAttributeAsKey('format') - ->requiresAtLeastOneElement() - ->defaultValue(['html' => 'CmfSeoBundle:Exception:error.html.twig']) - ->prototype('scalar')->end() - ->end() - ->arrayNode('exclusion_rules') - ->info('Rules to exclude error handling from specific matches.') - ->prototype('array') - ->children() - ->scalarNode('path')->defaultNull()->info('Path to exclude')->end() - ->scalarNode('host')->defaultNull()->info('Host to exclude')->end() - ->scalarNode('methods')->defaultNull()->info('Methods to exclude')->end() - ->scalarNode('ips')->defaultNull()->info('Ips to exclude')->end() + $root + ->children() + ->arrayNode('error') + ->fixXmlConfig('template') + ->fixXmlConfig('exclusion_rule') + ->children() + ->booleanNode('enable_parent_provider')->defaultFalse()->end() + ->booleanNode('enable_sibling_provider')->defaultFalse()->end() + ->arrayNode('templates') + ->useAttributeAsKey('format') + ->requiresAtLeastOneElement() + ->defaultValue(['html' => 'CmfSeoBundle:Exception:error.html.twig']) + ->prototype('scalar')->end() + ->end() + ->arrayNode('exclusion_rules') + ->info('Rules to exclude error handling from specific matches.') + ->prototype('array') + ->children() + ->scalarNode('path')->defaultNull()->info('Path to exclude')->end() + ->scalarNode('host')->defaultNull()->info('Host to exclude')->end() + ->scalarNode('methods')->defaultNull()->info('Methods to exclude')->end() + ->scalarNode('ips')->defaultNull()->info('Ips to exclude')->end() + ->end() ->end() ->end() ->end() @@ -192,52 +196,54 @@ private function addErrorHandlerSection(ArrayNodeDefinition $nodeBuilder) /** * Attach the sitemap node to the tree. * - * @param NodeBuilder $nodeBuilder + * @param ArrayNodeDefinition $root */ - private function addSitemapSection(ArrayNodeDefinition $nodeBuilder) + private function addSitemapSection(ArrayNodeDefinition $root) { - $nodeBuilder - ->arrayNode('sitemap') - ->fixXmlConfig('configuration') - ->addDefaultsIfNotSet() - ->canBeEnabled() - ->children() - ->arrayNode('defaults') - ->fixXmlConfig('template') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('default_change_frequency')->defaultValue('always')->end() - ->arrayNode('templates') - ->useAttributeAsKey('format') - ->requiresAtLeastOneElement() - ->defaultValue([ - 'html' => 'CmfSeoBundle:Sitemap:index.html.twig', - 'xml' => 'CmfSeoBundle:Sitemap:index.xml.twig', - ]) - ->prototype('scalar')->end() - ->end() - ->append($this->getSitemapHelperNode('loaders', ['_all'])) - ->append($this->getSitemapHelperNode('guessers', ['_all'])) - ->append($this->getSitemapHelperNode('voters', ['_all'])) - ->end() - ->end() - ->arrayNode('configurations') - ->useAttributeAsKey('name') - ->prototype('array') + $root + ->children() + ->arrayNode('sitemap') + ->fixXmlConfig('configuration') + ->addDefaultsIfNotSet() + ->canBeEnabled() + ->children() + ->arrayNode('defaults') ->fixXmlConfig('template') - ->fixXmlConfig('loader') - ->fixXmlConfig('guesser') - ->fixXmlConfig('voter') + ->addDefaultsIfNotSet() ->children() - ->scalarNode('default_change_frequency')->defaultNull()->end() + ->scalarNode('default_change_frequency')->defaultValue('always')->end() ->arrayNode('templates') ->useAttributeAsKey('format') ->requiresAtLeastOneElement() + ->defaultValue([ + 'html' => 'CmfSeoBundle:Sitemap:index.html.twig', + 'xml' => 'CmfSeoBundle:Sitemap:index.xml.twig', + ]) ->prototype('scalar')->end() ->end() - ->append($this->getSitemapHelperNode('loaders', [])) - ->append($this->getSitemapHelperNode('guessers', [])) - ->append($this->getSitemapHelperNode('voters', [])) + ->append($this->getSitemapHelperNode('loaders', ['_all'])) + ->append($this->getSitemapHelperNode('guessers', ['_all'])) + ->append($this->getSitemapHelperNode('voters', ['_all'])) + ->end() + ->end() + ->arrayNode('configurations') + ->useAttributeAsKey('name') + ->prototype('array') + ->fixXmlConfig('template') + ->fixXmlConfig('loader') + ->fixXmlConfig('guesser') + ->fixXmlConfig('voter') + ->children() + ->scalarNode('default_change_frequency')->defaultNull()->end() + ->arrayNode('templates') + ->useAttributeAsKey('format') + ->requiresAtLeastOneElement() + ->prototype('scalar')->end() + ->end() + ->append($this->getSitemapHelperNode('loaders', [])) + ->append($this->getSitemapHelperNode('guessers', [])) + ->append($this->getSitemapHelperNode('voters', [])) + ->end() ->end() ->end() ->end() @@ -246,7 +252,13 @@ private function addSitemapSection(ArrayNodeDefinition $nodeBuilder) ; } - private function getSitemapHelperNode($type, $default) + /** + * @param string $type + * @param string $default + * + * @return ArrayNodeDefinition + */ + private function getSitemapHelperNode($type, $default): ArrayNodeDefinition { $node = new ArrayNodeDefinition($type); $node @@ -269,16 +281,18 @@ private function getSitemapHelperNode($type, $default) /** * Attach the content listener node to the tree. * - * @param NodeBuilder $nodeBuilder + * @param ArrayNodeDefinition $root */ - private function addContentListenerSection(ArrayNodeDefinition $nodeBuilder) + private function addContentListenerSection(ArrayNodeDefinition $root) { - $nodeBuilder - ->arrayNode('content_listener') - ->canBeDisabled() - ->children() - ->scalarNode('content_key') - ->defaultValue(class_exists('Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter') ? DynamicRouter::CONTENT_KEY : '') + $root + ->children() + ->arrayNode('content_listener') + ->canBeDisabled() + ->children() + ->scalarNode('content_key') + ->defaultValue(class_exists('Symfony\Cmf\Bundle\RoutingBundle\Routing\DynamicRouter') ? DynamicRouter::CONTENT_KEY : '') + ->end() ->end() ->end() ; @@ -287,28 +301,30 @@ private function addContentListenerSection(ArrayNodeDefinition $nodeBuilder) /** * Attach the form node to the tree. * - * @param NodeBuilder $nodeBuilder + * @param ArrayNodeDefinition $root */ - private function addFormSection($nodeBuilder) + private function addFormSection(ArrayNodeDefinition $root) { - $nodeBuilder - ->arrayNode('form') - ->addDefaultsIfNotSet() - ->fixXmlConfig('option') - ->children() - ->arrayNode('data_class') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('seo_metadata')->defaultNull()->end() + $root + ->children() + ->arrayNode('form') + ->addDefaultsIfNotSet() + ->fixXmlConfig('option') + ->children() + ->arrayNode('data_class') + ->addDefaultsIfNotSet() + ->children() + ->scalarNode('seo_metadata')->defaultNull()->end() + ->end() ->end() - ->end() - ->arrayNode('options') - ->addDefaultsIfNotSet() - ->children() - ->enumNode('generic_metadata') - ->info('Whether to show fields to edit generic SEO information. Needs burgov/key-value-form-bundle.') - ->values([true, false, 'auto']) - ->defaultValue('auto') + ->arrayNode('options') + ->addDefaultsIfNotSet() + ->children() + ->enumNode('generic_metadata') + ->info('Whether to show fields to edit generic SEO information. Needs burgov/key-value-form-bundle.') + ->values([true, false, 'auto']) + ->defaultValue('auto') + ->end() ->end() ->end() ->end() From 1440f448b586676f318f43707372ff772a913a64 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Tue, 26 Feb 2019 16:23:23 +0100 Subject: [PATCH 20/27] some cs fixes --- .gitignore | 3 +- build/xdebug-filter.php | 20 ++- src/AlternateLocaleProviderInterface.php | 4 +- src/Cache/CacheInterface.php | 4 +- src/Cache/ExtractorCollection.php | 10 +- src/Cache/FileCache.php | 58 ++++---- src/CmfSeoBundle.php | 4 +- src/Controller/SitemapController.php | 6 +- .../SuggestionProviderController.php | 4 +- src/DependencyInjection/CmfSeoExtension.php | 20 +-- .../Compiler/RegisterExtractorsPass.php | 4 +- .../RegisterSuggestionProviderPass.php | 4 +- .../RegisterUrlInformationProviderPass.php | 6 +- src/DependencyInjection/ConfigValues.php | 6 +- src/DependencyInjection/Configuration.php | 11 +- .../Phpcr/AlternateLocaleProvider.php | 8 +- src/Doctrine/Phpcr/BaseSuggestionProvider.php | 10 +- .../Phpcr/ParentSuggestionProvider.php | 4 +- src/Doctrine/Phpcr/SeoMetadata.php | 4 +- .../Phpcr/SiblingSuggestionProvider.php | 4 +- .../Phpcr/SitemapDocumentProvider.php | 4 +- src/EventListener/ContentListener.php | 20 +-- src/EventListener/LanguageListener.php | 4 +- src/Exception/ExtractorStrategyException.php | 4 +- src/Exception/InvalidArgumentException.php | 4 +- src/Extractor/DescriptionExtractor.php | 4 +- src/Extractor/DescriptionReadInterface.php | 4 +- src/Extractor/ExtractorInterface.php | 4 +- src/Extractor/ExtrasExtractor.php | 6 +- src/Extractor/ExtrasReadInterface.php | 4 +- src/Extractor/KeywordsExtractor.php | 6 +- src/Extractor/KeywordsReadInterface.php | 4 +- src/Extractor/OriginalRouteExtractor.php | 4 +- src/Extractor/OriginalRouteReadInterface.php | 4 +- src/Extractor/OriginalUrlExtractor.php | 4 +- src/Extractor/OriginalUrlReadInterface.php | 4 +- src/Extractor/TitleExtractor.php | 4 +- src/Extractor/TitleReadExtractor.php | 4 +- src/Extractor/TitleReadInterface.php | 4 +- src/Form/Type/SeoMetadataType.php | 4 +- src/Matcher/ExclusionMatcher.php | 4 +- src/Model/AlternateLocale.php | 6 +- src/Model/AlternateLocaleCollection.php | 4 +- src/Model/SeoMetadata.php | 18 +-- src/Model/SeoMetadataInterface.php | 4 +- src/Model/UrlInformation.php | 6 +- src/SeoAwareInterface.php | 4 +- src/SeoAwareTrait.php | 4 +- src/SeoPresentation.php | 107 +++++++-------- src/SeoPresentationInterface.php | 4 +- src/Sitemap/AbstractChain.php | 4 +- src/Sitemap/AlternateLocalesGuesser.php | 4 +- src/Sitemap/DefaultChangeFrequencyGuesser.php | 4 +- src/Sitemap/DepthGuesser.php | 6 +- src/Sitemap/GuesserChain.php | 4 +- src/Sitemap/GuesserInterface.php | 4 +- src/Sitemap/LastModifiedGuesser.php | 10 +- src/Sitemap/LoaderChain.php | 4 +- src/Sitemap/LoaderInterface.php | 4 +- src/Sitemap/LocationGuesser.php | 4 +- src/Sitemap/PublishWorkflowVoter.php | 4 +- src/Sitemap/SeoMetadataTitleGuesser.php | 4 +- src/Sitemap/SitemapAwareDocumentVoter.php | 4 +- src/Sitemap/UrlInformationProvider.php | 4 +- src/Sitemap/VoterChain.php | 4 +- src/Sitemap/VoterInterface.php | 4 +- src/SitemapAwareInterface.php | 4 +- src/SuggestionProviderInterface.php | 4 +- src/Twig/Extension/CmfSeoExtension.php | 4 +- .../Doctrine/Orm/SeoMetadataTest.php | 28 ++-- .../Doctrine/Phpcr/SeoMetadataTest.php | 11 +- .../Phpcr/SitemapDocumentProviderTest.php | 4 +- tests/Unit/Cache/FileCacheTest.php | 6 +- .../Unit/Controller/SitemapControllerTest.php | 4 +- .../CmfSeoExtensionTest.php | 62 +++++---- .../Compiler/RegisterExtractorsPassTest.php | 14 +- .../RegisterSuggestionProviderPassTest.php | 26 ++-- ...RegisterUrlInformationProviderPassTest.php | 26 ++-- .../DependencyInjection/ConfigValuesTest.php | 9 +- .../DependencyInjection/ConfigurationTest.php | 24 ++-- .../DependencyInjection/XmlSchemaTest.php | 4 +- .../EventListener/ContentListenerTest.php | 4 +- .../EventListener/LanguageListenerTest.php | 4 +- tests/Unit/Extractor/BaseTestCase.php | 4 +- .../Extractor/DescriptionExtractorTest.php | 4 +- tests/Unit/Extractor/ExtrasExtractorTest.php | 4 +- .../Unit/Extractor/KeywordsExtractorTest.php | 4 +- .../Extractor/OriginalRouteExtractorTest.php | 4 +- .../Extractor/OriginalUrlExtractorTest.php | 4 +- tests/Unit/Extractor/TitleExtractorTest.php | 4 +- .../Unit/Extractor/TitleReadExtractorTest.php | 4 +- tests/Unit/Form/Type/SeoMetadataTypeTest.php | 36 ++--- tests/Unit/Matcher/ExclusionMatcherTest.php | 4 +- tests/Unit/Model/UrlInformationTest.php | 11 +- tests/Unit/SeoPresentationTest.php | 4 +- tests/Unit/Sitemap/AbstractChainTest.php | 4 +- .../Sitemap/AlternateLocalesGuesserTest.php | 4 +- .../DefaultChangeFrequencyGuesserTest.php | 4 +- tests/Unit/Sitemap/DepthGuesserTest.php | 128 +++++++++--------- tests/Unit/Sitemap/GuesserTestCase.php | 4 +- .../Unit/Sitemap/LastModifiedGuesserTest.php | 22 +-- tests/Unit/Sitemap/LocationGuesserTest.php | 4 +- .../Sitemap/SeoMetadataTitleGuesserTest.php | 4 +- .../Sitemap/SitemapAwareDocumentVoterTest.php | 4 +- .../Sitemap/UrlInformationProviderTest.php | 4 +- tests/WebTest/SeoFrontendTest.php | 4 +- tests/WebTest/SitemapTest.php | 4 +- tests/bootstrap.php | 4 +- 108 files changed, 632 insertions(+), 414 deletions(-) diff --git a/.gitignore b/.gitignore index c7730005..df05c4b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ tests/Fixtures/App/var !tests/Fixtures/App/var/.gitempty -.php_cs composer.lock vendor +/.php_cs +.php_cs.cache diff --git a/build/xdebug-filter.php b/build/xdebug-filter.php index a778f83a..346a4b7f 100644 --- a/build/xdebug-filter.php +++ b/build/xdebug-filter.php @@ -1,12 +1,24 @@ -dir = $baseDir.DIRECTORY_SEPARATOR.rtrim($dir, '\\/'); + $this->dir = $baseDir.\DIRECTORY_SEPARATOR.rtrim($dir, '\\/'); $this->umask = $umask; @@ -74,32 +76,6 @@ public function putExtractorsInCache($class, array $extractors) $this->renameFile($tmpFile, $path); } - /** - * Renames a file with fallback for windows. - * - * @param string $source - * @param string $target - * - * @throws \RuntimeException When the renaming can't be completed succesfully - * - * @author Johannes M. Schmitt - */ - private function renameFile($source, $target) - { - if (false === @rename($source, $target)) { - if (defined('PHP_WINDOWS_VERSION_BUILD')) { - if (false === copy($source, $target)) { - throw new \RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target)); - } - if (false === unlink($source)) { - throw new \RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source)); - } - } else { - throw new \RuntimeException(sprintf('Could not write new cache file to %s.', $target)); - } - } - } - /** * {@inheritdoc} */ @@ -128,4 +104,30 @@ public function clear($cacheDir) $filesystem->remove($this->dir); } } + + /** + * Renames a file with fallback for windows. + * + * @param string $source + * @param string $target + * + * @throws \RuntimeException When the renaming can't be completed succesfully + * + * @author Johannes M. Schmitt + */ + private function renameFile($source, $target) + { + if (false === @rename($source, $target)) { + if (\defined('PHP_WINDOWS_VERSION_BUILD')) { + if (false === copy($source, $target)) { + throw new \RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target)); + } + if (false === unlink($source)) { + throw new \RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source)); + } + } else { + throw new \RuntimeException(sprintf('Could not write new cache file to %s.', $target)); + } + } + } } diff --git a/src/CmfSeoBundle.php b/src/CmfSeoBundle.php index 3a00b9f4..5eebc1f0 100644 --- a/src/CmfSeoBundle.php +++ b/src/CmfSeoBundle.php @@ -1,9 +1,11 @@ configurations[$sitemap]['templates']; $supportedFormats = array_merge(['json'], array_keys($templates)); - if (!in_array($_format, $supportedFormats)) { + if (!\in_array($_format, $supportedFormats, true)) { $text = sprintf( 'Unknown format %s, use one of %s.', $_format, diff --git a/src/Controller/SuggestionProviderController.php b/src/Controller/SuggestionProviderController.php index 1014a739..64c7cd25 100644 --- a/src/Controller/SuggestionProviderController.php +++ b/src/Controller/SuggestionProviderController.php @@ -1,9 +1,11 @@ loadErrorHandling($errorConfig, $container); if ($this->isConfigEnabled($container, $config['sitemap'])) { @@ -116,7 +118,7 @@ public function loadSeoParameters(array $config, ContainerBuilder $container) $params = ['translation_domain', 'title', 'description', 'original_route_pattern']; foreach ($params as $param) { - $value = isset($config[$param]) ? $config[$param] : null; + $value = $config[$param] ?? null; $container->setParameter('cmf_seo.'.$param, $value); } } @@ -218,8 +220,8 @@ private function loadErrorHandling($config, ContainerBuilder $container) } } - $templates = isset($config['templates']) ? $config['templates'] : []; - $exclusionRules = isset($config['exclusion_rules']) ? $config['exclusion_rules'] : []; + $templates = $config['templates'] ?? []; + $exclusionRules = $config['exclusion_rules'] ?? []; $container->setParameter('cmf_seo.error.templates', $templates); $exclusionMatcherDefinition = $container->getDefinition('cmf_seo.error.exclusion_matcher'); @@ -305,7 +307,7 @@ private function loadSitemapHandling($config, XmlFileLoader $loader, ContainerBu } } foreach ($helperStatus as $helper => $map) { - $status = count($configuration[$helper]) ? $configuration[$helper] : $config['defaults'][$helper]; + $status = \count($configuration[$helper]) ? $configuration[$helper] : $config['defaults'][$helper]; foreach ($status as $s) { if ('_all' === $s) { @@ -344,7 +346,7 @@ private function handleSitemapHelper($helperStatus, ContainerBuilder $container) { foreach ($helperStatus as $type => $status) { foreach ($status as $id => $sitemaps) { - if (count($sitemaps)) { + if (\count($sitemaps)) { $definition = $container->getDefinition($id); $tags = $definition->getTag($this->sitemapHelperMap[$type]); $tag = reset($tags); @@ -380,10 +382,10 @@ private function loadFormConfiguration($config, ContainerBuilder $container, $st $genericMetadata = false; if ($config['options']['generic_metadata']) { $bundles = $container->getParameter('kernel.bundles'); - if (true === $config['options']['generic_metadata'] && !array_key_exists('BurgovKeyValueFormBundle', $bundles)) { + if (true === $config['options']['generic_metadata'] && !\array_key_exists('BurgovKeyValueFormBundle', $bundles)) { throw new InvalidConfigurationException('To edit generic fields for the HTML header, you need the burgov/key-value-form-bundle in your project.'); } - $genericMetadata = array_key_exists('BurgovKeyValueFormBundle', $bundles); + $genericMetadata = \array_key_exists('BurgovKeyValueFormBundle', $bundles); } $container->setParameter('cmf_seo.form.options', [ diff --git a/src/DependencyInjection/Compiler/RegisterExtractorsPass.php b/src/DependencyInjection/Compiler/RegisterExtractorsPass.php index e1551d33..69f17eef 100644 --- a/src/DependencyInjection/Compiler/RegisterExtractorsPass.php +++ b/src/DependencyInjection/Compiler/RegisterExtractorsPass.php @@ -1,9 +1,11 @@ getRootNode(); } - $rootNode ->addDefaultsIfNotSet() ->beforeNormalization() ->ifTrue(function ($config) { return isset($config['sitemap']) && (!isset($config['sitemap']['configurations']) - || 0 === count($config['sitemap']['configurations']) + || 0 === \count($config['sitemap']['configurations']) ) && !isset($config['sitemap']['configuration']) // xml configuration ; @@ -57,7 +58,7 @@ public function getConfigTreeBuilder() 'sitemap' => [], ], ]; - } elseif (is_array($config['sitemap'])) { + } elseif (\is_array($config['sitemap'])) { $config['sitemap']['configurations'] = ['sitemap' => []]; } @@ -264,7 +265,7 @@ private function getSitemapHelperNode($type, $default): ArrayNodeDefinition $node ->beforeNormalization() ->ifTrue(function ($config) { - return is_string($config); + return \is_string($config); }) ->then(function ($config) { return [$config]; diff --git a/src/Doctrine/Phpcr/AlternateLocaleProvider.php b/src/Doctrine/Phpcr/AlternateLocaleProvider.php index 84d793da..abd12a31 100644 --- a/src/Doctrine/Phpcr/AlternateLocaleProvider.php +++ b/src/Doctrine/Phpcr/AlternateLocaleProvider.php @@ -1,9 +1,11 @@ getDocumentManagerForClass(get_class($content)); + $documentManager = $this->getDocumentManagerForClass(\get_class($content)); if (null === $documentManager) { return $alternateLocaleCollection; } @@ -111,7 +113,7 @@ public function createForContents(array $contents) * * @param $class * - * @return DocumentManager|null|object + * @return DocumentManager|object|null */ private function getDocumentManagerForClass($class) { diff --git a/src/Doctrine/Phpcr/BaseSuggestionProvider.php b/src/Doctrine/Phpcr/BaseSuggestionProvider.php index 6e575a2b..ce8e454c 100644 --- a/src/Doctrine/Phpcr/BaseSuggestionProvider.php +++ b/src/Doctrine/Phpcr/BaseSuggestionProvider.php @@ -1,9 +1,11 @@ findMany(null, $parentPaths); - if (0 === count($parentRoutes)) { + if (0 === \count($parentRoutes)) { return; } diff --git a/src/Doctrine/Phpcr/ParentSuggestionProvider.php b/src/Doctrine/Phpcr/ParentSuggestionProvider.php index 9463d1d6..9d82f8e2 100644 --- a/src/Doctrine/Phpcr/ParentSuggestionProvider.php +++ b/src/Doctrine/Phpcr/ParentSuggestionProvider.php @@ -1,9 +1,11 @@ alternateLocaleProvider = $alternateLocaleProvider; + } + protected function canBeRedirected(Request $request, RedirectResponse $response) { $targetRequest = Request::create($response->getTargetUrl()); @@ -86,12 +96,4 @@ protected function canBeRedirected(Request $request, RedirectResponse $response) return $targetPath !== $currentPath; } - - /** - * @param AlternateLocaleProviderInterface $alternateLocaleProvider - */ - public function setAlternateLocaleProvider($alternateLocaleProvider) - { - $this->alternateLocaleProvider = $alternateLocaleProvider; - } } diff --git a/src/EventListener/LanguageListener.php b/src/EventListener/LanguageListener.php index 046a914f..4eebe585 100644 --- a/src/EventListener/LanguageListener.php +++ b/src/EventListener/LanguageListener.php @@ -1,9 +1,11 @@ getSeoExtras(); foreach ($contentExtras as $type => $extras) { - if (!array_key_exists($type, $allowedTypesMethodMapping)) { + if (!\array_key_exists($type, $allowedTypesMethodMapping)) { throw new InvalidArgumentException( printf( 'Extras type %s not in the list of allowed ones %s.', diff --git a/src/Extractor/ExtrasReadInterface.php b/src/Extractor/ExtrasReadInterface.php index 5492b1d6..6fdaac94 100644 --- a/src/Extractor/ExtrasReadInterface.php +++ b/src/Extractor/ExtrasReadInterface.php @@ -1,9 +1,11 @@ getSeoKeywords(); - if (is_array($keywords)) { + if (\is_array($keywords)) { $keywords = implode(', ', $keywords); } diff --git a/src/Extractor/KeywordsReadInterface.php b/src/Extractor/KeywordsReadInterface.php index ec070822..f7914cc0 100644 --- a/src/Extractor/KeywordsReadInterface.php +++ b/src/Extractor/KeywordsReadInterface.php @@ -1,9 +1,11 @@ extraProperties)) { + if (\array_key_exists($key, $this->extraProperties)) { unset($this->extraProperties[$key]); } } @@ -256,7 +258,7 @@ public function addExtraName($key, $value) */ public function removeExtraName($key) { - if (array_key_exists($key, $this->extraNames)) { + if (\array_key_exists($key, $this->extraNames)) { unset($this->extraNames[$key]); } } @@ -292,7 +294,7 @@ public function addExtraHttp($key, $value) */ public function removeExtraHttp($key) { - if (array_key_exists($key, $this->extraHttp)) { + if (\array_key_exists($key, $this->extraHttp)) { unset($this->extraHttp[$key]); } } @@ -302,13 +304,13 @@ public function removeExtraHttp($key) * * @param array|KeyValueContainer|\Traversable $data something that can be converted to an array * - * @return array Native array representation of $data - * * @throws InvalidArgumentException if $data can not be converted to an array + * + * @return array Native array representation of $data */ private function toArray($data) { - if (is_array($data)) { + if (\is_array($data)) { return $data; } @@ -322,6 +324,6 @@ private function toArray($data) throw new InvalidArgumentException( sprintf('Expected array, Traversable or KeyValueContainer, got "%s"', - is_object($data) ? get_class($data) : gettype($data))); + \is_object($data) ? \get_class($data) : \gettype($data))); } } diff --git a/src/Model/SeoMetadataInterface.php b/src/Model/SeoMetadataInterface.php index ce0a1d51..4d087597 100644 --- a/src/Model/SeoMetadataInterface.php +++ b/src/Model/SeoMetadataInterface.php @@ -1,9 +1,11 @@ allowedChangeFrequencies)) { + if (!\in_array($changeFrequency, $this->allowedChangeFrequencies, true)) { throw new InvalidArgumentException( sprintf('Invalid change frequency "%s", use one of %s.', $changeFrequency, implode(', ', $this->allowedChangeFrequencies)) ); diff --git a/src/SeoAwareInterface.php b/src/SeoAwareInterface.php index 54f11305..d9a4f699 100644 --- a/src/SeoAwareInterface.php +++ b/src/SeoAwareInterface.php @@ -1,9 +1,11 @@ cache = $cache; } - /** - * @param RedirectResponse $redirect - */ - private function setRedirectResponse(RedirectResponse $redirect) - { - $this->redirectResponse = $redirect; - } - /** * {@inheritdoc} */ @@ -156,7 +150,7 @@ public function getSeoMetadata($content) throw new InvalidArgumentException( sprintf( 'getSeoMetadata must return either an instance of SeoMetadataInterface or null, "%s" given', - is_object($contentSeoMetadata) ? get_class($contentSeoMetadata) : gettype($contentSeoMetadata) + \is_object($contentSeoMetadata) ? \get_class($contentSeoMetadata) : \gettype($contentSeoMetadata) ) ); } @@ -166,11 +160,11 @@ public function getSeoMetadata($content) $cachingAvailable = (bool) $this->cache; if ($cachingAvailable) { - $extractors = $this->cache->loadExtractorsFromCache(get_class($content)); + $extractors = $this->cache->loadExtractorsFromCache(\get_class($content)); if (null === $extractors || !$extractors->isFresh()) { $extractors = $this->getExtractorsForContent($content); - $this->cache->putExtractorsInCache(get_class($content), $extractors); + $this->cache->putExtractorsInCache(\get_class($content), $extractors); } } else { $extractors = $this->getExtractorsForContent($content); @@ -183,28 +177,6 @@ public function getSeoMetadata($content) return $seoMetadata; } - /** - * Returns the extractors for content. - * - * @param object $content - * - * @return ExtractorInterface[] - */ - private function getExtractorsForContent($content) - { - $extractors = []; - ksort($this->extractors); - foreach ($this->extractors as $priority) { - $supportedExtractors = array_filter($priority, function (ExtractorInterface $extractor) use ($content) { - return $extractor->supports($content); - }); - - $extractors = array_merge($extractors, $supportedExtractors); - } - - return $extractors; - } - /** * {@inheritdoc} */ @@ -284,6 +256,49 @@ public function updateSeoPage($content) } } + /** + * {inheritDoc}. + */ + public function updateAlternateLocales(AlternateLocaleCollection $collection) + { + foreach ($collection as $alternateLocale) { + $this->sonataPage->addLangAlternate( + $alternateLocale->href, + $alternateLocale->hrefLocale + ); + } + } + + /** + * @param RedirectResponse $redirect + */ + private function setRedirectResponse(RedirectResponse $redirect) + { + $this->redirectResponse = $redirect; + } + + /** + * Returns the extractors for content. + * + * @param object $content + * + * @return ExtractorInterface[] + */ + private function getExtractorsForContent($content) + { + $extractors = []; + ksort($this->extractors); + foreach ($this->extractors as $priority) { + $supportedExtractors = array_filter($priority, function (ExtractorInterface $extractor) use ($content) { + return $extractor->supports($content); + }); + + $extractors = array_merge($extractors, $supportedExtractors); + } + + return $extractors; + } + /** * Creates a concatenated list of keywords based on sonatas default * values. @@ -295,9 +310,8 @@ public function updateSeoPage($content) private function createKeywords($contentKeywords) { $metas = $this->sonataPage->getMetas(); - $sonataKeywords = isset($metas['name']['keywords'][0]) - ? $metas['name']['keywords'][0] - : ''; + $sonataKeywords = $metas['name']['keywords'][0] + ?? ''; return ('' !== $sonataKeywords ? $sonataKeywords.', ' : '').$contentKeywords; } @@ -323,17 +337,4 @@ private function copyMetadata(SeoMetadataInterface $contentSeoMetadata) ->setExtraHttp($contentSeoMetadata->getExtraHttp() ?: []) ; } - - /** - * {inheritDoc}. - */ - public function updateAlternateLocales(AlternateLocaleCollection $collection) - { - foreach ($collection as $alternateLocale) { - $this->sonataPage->addLangAlternate( - $alternateLocale->href, - $alternateLocale->hrefLocale - ); - } - } } diff --git a/src/SeoPresentationInterface.php b/src/SeoPresentationInterface.php index b2b12d32..a05acb5a 100644 --- a/src/SeoPresentationInterface.php +++ b/src/SeoPresentationInterface.php @@ -1,9 +1,11 @@ managerRegistry->getManagerForClass(ClassUtils::getRealClass(get_class($object))); + $manager = $this->managerRegistry->getManagerForClass(ClassUtils::getRealClass(\get_class($object))); if (!$manager instanceof DocumentManager) { return; } diff --git a/src/Sitemap/GuesserChain.php b/src/Sitemap/GuesserChain.php index bd870178..3f74accc 100644 --- a/src/Sitemap/GuesserChain.php +++ b/src/Sitemap/GuesserChain.php @@ -1,9 +1,11 @@ managerRegistry->getManagerForClass($className); if (!$manager instanceof DocumentManager) { return; @@ -63,7 +65,7 @@ public function guessValues(UrlInformation $urlInformation, $object, $sitemap) $metadata = $manager->getClassMetadata($className); $mixins = $metadata->getMixins(); - if (!in_array('mix:lastModified', $mixins)) { + if (!\in_array('mix:lastModified', $mixins, true)) { return; } @@ -83,7 +85,5 @@ private function getFieldName(ClassMetadata $metadata) return $fieldName; } } - - return; } } diff --git a/src/Sitemap/LoaderChain.php b/src/Sitemap/LoaderChain.php index 8b4153d3..17ce075f 100644 --- a/src/Sitemap/LoaderChain.php +++ b/src/Sitemap/LoaderChain.php @@ -1,9 +1,11 @@ getDbManager('ORM')->getOm()))->purge(); } - protected function getKernelConfiguration() - { - return [ - 'environment' => 'orm', - ]; - } - - protected function getEm() - { - return $this->db('ORM')->getOm(); - } - public function testSeoMetadata() { $content = new SeoAwareOrmContent(); @@ -69,4 +59,16 @@ public function testSeoMetadata() $persistedSeoMetadata = $content->getSeoMetadata(); $this->assertEquals($seoMetadata, $persistedSeoMetadata); } + + protected function getKernelConfiguration() + { + return [ + 'environment' => 'orm', + ]; + } + + protected function getEm() + { + return $this->db('ORM')->getOm(); + } } diff --git a/tests/Functional/Doctrine/Phpcr/SeoMetadataTest.php b/tests/Functional/Doctrine/Phpcr/SeoMetadataTest.php index cb69aee8..34122ccc 100644 --- a/tests/Functional/Doctrine/Phpcr/SeoMetadataTest.php +++ b/tests/Functional/Doctrine/Phpcr/SeoMetadataTest.php @@ -1,9 +1,11 @@ assertEquals($seoMetadata->getExtraHttp(), $persistedSeoMetadata->getExtraHttp()); } - /** - * @expectedException \Doctrine\ODM\PHPCR\Exception\OutOfBoundsException - * @expectedExceptionMessage It cannot have children - */ public function testAddSeoMetadataChild() { + $this->expectException(\Doctrine\ODM\PHPCR\Exception\OutOfBoundsException::class); + $this->expectExceptionMessage('It cannot have children'); + $seoMetadata = new SeoMetadata(); $seoMetadata->setName('seo-metadata'); $seoMetadata->setParentDocument($this->dm->find(null, '/test')); diff --git a/tests/Functional/Doctrine/Phpcr/SitemapDocumentProviderTest.php b/tests/Functional/Doctrine/Phpcr/SitemapDocumentProviderTest.php index 3c6e32e1..29dfb61a 100644 --- a/tests/Functional/Doctrine/Phpcr/SitemapDocumentProviderTest.php +++ b/tests/Functional/Doctrine/Phpcr/SitemapDocumentProviderTest.php @@ -1,9 +1,11 @@ assertTrue(is_dir($expectedDirectory)); + $this->assertDirectoryExists($expectedDirectory); rmdir($expectedDirectory); rmdir($baseDir); diff --git a/tests/Unit/Controller/SitemapControllerTest.php b/tests/Unit/Controller/SitemapControllerTest.php index 8f15e757..67629b90 100644 --- a/tests/Unit/Controller/SitemapControllerTest.php +++ b/tests/Unit/Controller/SitemapControllerTest.php @@ -1,9 +1,11 @@ container->setParameter( @@ -225,25 +217,6 @@ public function testErrorHandlingPHPCR() $this->assertMatcherCreated($attributes); } - /** - * @param array $arguments - */ - private function assertMatcherCreated(array $arguments) - { - $count = 0; - foreach ($this->container->getDefinitions() as $id => $definition) { - if (($definition instanceof DefinitionDecorator || $definition instanceof ChildDefinition) - && 'cmf_seo.error.request_matcher' === $definition->getParent() - ) { - ++$count; - $this->assertNotNull($definition); - $this->assertEquals($arguments[$count - 1], $definition->getArguments()); - } - } - - $this->assertEquals(2, $count); - } - public function testSitemapConfiguration() { $this->container->setParameter( @@ -467,4 +440,33 @@ public function testDisableSeoContentListener() 'cmf_seo.event_listener.seo_content' ); } + + /** + * {@inheritdoc} + */ + protected function getContainerExtensions() + { + return [ + new CmfSeoExtension(), + ]; + } + + /** + * @param array $arguments + */ + private function assertMatcherCreated(array $arguments) + { + $count = 0; + foreach ($this->container->getDefinitions() as $id => $definition) { + if (($definition instanceof DefinitionDecorator || $definition instanceof ChildDefinition) + && 'cmf_seo.error.request_matcher' === $definition->getParent() + ) { + ++$count; + $this->assertNotNull($definition); + $this->assertEquals($arguments[$count - 1], $definition->getArguments()); + } + } + + $this->assertEquals(2, $count); + } } diff --git a/tests/Unit/DependencyInjection/Compiler/RegisterExtractorsPassTest.php b/tests/Unit/DependencyInjection/Compiler/RegisterExtractorsPassTest.php index 59dcfe59..7830b296 100644 --- a/tests/Unit/DependencyInjection/Compiler/RegisterExtractorsPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/RegisterExtractorsPassTest.php @@ -1,9 +1,11 @@ addCompilerPass(new RegisterExtractorsPass()); - } - public function testRegistersServicesWithExtractorTagAndDefaultPriority() { $nonExtractorService = new Definition(); @@ -65,4 +62,9 @@ public function testRegistersServicesWithExtractorTagAndPriority() [new Reference('extractor_service'), 1] ); } + + protected function registerCompilerPass(ContainerBuilder $container) + { + $container->addCompilerPass(new RegisterExtractorsPass()); + } } diff --git a/tests/Unit/DependencyInjection/Compiler/RegisterSuggestionProviderPassTest.php b/tests/Unit/DependencyInjection/Compiler/RegisterSuggestionProviderPassTest.php index 8bedd517..630a6eb5 100644 --- a/tests/Unit/DependencyInjection/Compiler/RegisterSuggestionProviderPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/RegisterSuggestionProviderPassTest.php @@ -1,9 +1,11 @@ addCompilerPass(new MyCompilerPass()); - */ - protected function registerCompilerPass(ContainerBuilder $container) - { - $container->addCompilerPass(new RegisterSuggestionProviderPass()); - } - public function testRegistersServicesWithMatcherTag() { $nonMatcherService = new Definition(); @@ -76,4 +67,15 @@ public function testRegistersServicesWithMatcherTagWithoutGroup() [['provider' => new Reference('matcher.without_group'), 'group' => 'default']] ); } + + /** + * Register the compiler pass under test, just like you would do inside a bundle's load() + * method:. + * + * $container->addCompilerPass(new MyCompilerPass()); + */ + protected function registerCompilerPass(ContainerBuilder $container) + { + $container->addCompilerPass(new RegisterSuggestionProviderPass()); + } } diff --git a/tests/Unit/DependencyInjection/Compiler/RegisterUrlInformationProviderPassTest.php b/tests/Unit/DependencyInjection/Compiler/RegisterUrlInformationProviderPassTest.php index ec5c8fef..03e203f6 100644 --- a/tests/Unit/DependencyInjection/Compiler/RegisterUrlInformationProviderPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/RegisterUrlInformationProviderPassTest.php @@ -1,9 +1,11 @@ addCompilerPass(new MyCompilerPass()); - */ - protected function registerCompilerPass(ContainerBuilder $container) - { - $container->addCompilerPass(new RegisterUrlInformationProviderPass()); - } - /** * @dataProvider tagProvider */ @@ -118,4 +109,15 @@ public function tagProvider() ['guesser', 'guesser_chain'], ]; } + + /** + * Register the compiler pass under test, just like you would do inside a bundle's load() + * method:. + * + * $container->addCompilerPass(new MyCompilerPass()); + */ + protected function registerCompilerPass(ContainerBuilder $container) + { + $container->addCompilerPass(new RegisterUrlInformationProviderPass()); + } } diff --git a/tests/Unit/DependencyInjection/ConfigValuesTest.php b/tests/Unit/DependencyInjection/ConfigValuesTest.php index 7a771836..10aef671 100644 --- a/tests/Unit/DependencyInjection/ConfigValuesTest.php +++ b/tests/Unit/DependencyInjection/ConfigValuesTest.php @@ -1,9 +1,11 @@ expectException(\Symfony\Cmf\Bundle\SeoBundle\Exception\ExtractorStrategyException::class); + $configValues = new ConfigValues(); $configValues->setOriginalUrlBehaviour('nonexistent'); } diff --git a/tests/Unit/DependencyInjection/ConfigurationTest.php b/tests/Unit/DependencyInjection/ConfigurationTest.php index 9d16fcc4..a3e21646 100644 --- a/tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/tests/Unit/DependencyInjection/ConfigurationTest.php @@ -1,9 +1,11 @@ assertProcessedConfigurationEquals($expectedConfiguration, $sources); } + + protected function getContainerExtension() + { + return new CmfSeoExtension(); + } + + protected function getConfiguration() + { + return new Configuration(); + } } diff --git a/tests/Unit/DependencyInjection/XmlSchemaTest.php b/tests/Unit/DependencyInjection/XmlSchemaTest.php index fae26f21..c1a0b1ec 100644 --- a/tests/Unit/DependencyInjection/XmlSchemaTest.php +++ b/tests/Unit/DependencyInjection/XmlSchemaTest.php @@ -1,9 +1,11 @@ validator), - new PreloadedExtension([ - new KeyValueType(), - new KeyValueRowType(), - new SeoMetadataType('Symfony\Cmf\Bundle\SeoBundle\Doctrine\Phpcr\SeoMetadata'), - new SeoMetadataTypeTest_OrmType('Symfony\Cmf\Bundle\SeoBundle\Model\SeoMetadata'), - ], []), - ] - ); - } - public function testDataClassCreationForPhpcr() { $this->validator->expects($this->any())->method('validate')->will($this->returnValue([])); @@ -110,6 +96,22 @@ public function testDataClassCreationForNonPhpcr() $this->assertTrue($form->isSynchronized()); $this->assertEquals($object, $form->getData()); } + + protected function getExtensions() + { + return array_merge( + parent::getExtensions(), + [ + new ValidatorExtension($this->validator), + new PreloadedExtension([ + new KeyValueType(), + new KeyValueRowType(), + new SeoMetadataType('Symfony\Cmf\Bundle\SeoBundle\Doctrine\Phpcr\SeoMetadata'), + new SeoMetadataTypeTest_OrmType('Symfony\Cmf\Bundle\SeoBundle\Model\SeoMetadata'), + ], []), + ] + ); + } } class SeoMetadataTypeTest_OrmType extends SeoMetadataType diff --git a/tests/Unit/Matcher/ExclusionMatcherTest.php b/tests/Unit/Matcher/ExclusionMatcherTest.php index 5dccbfb0..9db33e5b 100644 --- a/tests/Unit/Matcher/ExclusionMatcherTest.php +++ b/tests/Unit/Matcher/ExclusionMatcherTest.php @@ -1,9 +1,11 @@ model = new UrlInformation(); } - /** - * @expectedException \Symfony\Cmf\Bundle\SeoBundle\Exception\InvalidArgumentException - * @expectedExceptionMessage Invalid change frequency "some one", use one of always, hourly, daily, weekly, monthly, yearly, never. - */ public function testSetChangeFrequencyShouldThrowExceptionForInvalidArguments() { + $this->expectException(\Symfony\Cmf\Bundle\SeoBundle\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid change frequency "some one", use one of always, hourly, daily, weekly, monthly, yearly, never.'); + $this->model->setChangeFrequency('some one'); } diff --git a/tests/Unit/SeoPresentationTest.php b/tests/Unit/SeoPresentationTest.php index 5ee3115d..7530255b 100644 --- a/tests/Unit/SeoPresentationTest.php +++ b/tests/Unit/SeoPresentationTest.php @@ -1,9 +1,11 @@ buildMocks(); - - $this->managerRegistry - ->expects($this->any()) - ->method('getManagerForClass') - ->with(get_class($this->object)) - ->will($this->returnValue($this->documentManager)); - $this->documentManager - ->expects($this->any()) - ->method('getNodeForDocument') - ->with($this->object) - ->willReturn($this->node); - $this->node - ->expects($this->any()) - ->method('getDepth') - ->will($this->returnValue(3)); - - return $this->guesser; - } - - /** - * @return object - */ - protected function createData() - { - return $this->object; - } - - /** - * Provide list of fields in UrlInformation covered by this guesser. - * - * @return array - */ - protected function getFields() - { - return ['depth']; - } - - /** - * Method to extract mock building. - * - * @param string $contentBasePath - */ - private function buildMocks($contentBasePath = '/cms/test') - { - $this->managerRegistry = $this->createMock(ManagerRegistry::class); - $this->documentManager = $this->createMock(DocumentManager::class); - $this->node = $this->createMock(NodeInterface::class); - $this->object = new \stdClass(); - $this->guesser = new DepthGuesser($this->managerRegistry, $contentBasePath); - } - public function testNullOnNoManager() { $this->buildMocks(); $this->managerRegistry ->expects($this->any()) ->method('getManagerForClass') - ->with(get_class($this->object)) + ->with(\get_class($this->object)) ->will($this->returnValue(null)); $urlInformation = new UrlInformation(); $this->guesser->guessValues($urlInformation, $this->object, 'default'); @@ -128,7 +71,7 @@ public function testDepthOffsetCalculation() $this->managerRegistry ->expects($this->any()) ->method('getManagerForClass') - ->with(get_class($this->object)) + ->with(\get_class($this->object)) ->will($this->returnValue($this->documentManager)); $this->documentManager ->expects($this->any()) @@ -152,7 +95,7 @@ public function testRootEdgeCase() $this->managerRegistry ->expects($this->any()) ->method('getManagerForClass') - ->with(get_class($this->object)) + ->with(\get_class($this->object)) ->will($this->returnValue($this->documentManager)); $this->documentManager ->expects($this->any()) @@ -168,4 +111,63 @@ public function testRootEdgeCase() $this->assertEquals(3, $urlInformation->getDepth()); } + + /** + * Create the guesser for this test. + * + * @return GuesserInterface + */ + protected function createGuesser() + { + $this->buildMocks(); + + $this->managerRegistry + ->expects($this->any()) + ->method('getManagerForClass') + ->with(\get_class($this->object)) + ->will($this->returnValue($this->documentManager)); + $this->documentManager + ->expects($this->any()) + ->method('getNodeForDocument') + ->with($this->object) + ->willReturn($this->node); + $this->node + ->expects($this->any()) + ->method('getDepth') + ->will($this->returnValue(3)); + + return $this->guesser; + } + + /** + * @return object + */ + protected function createData() + { + return $this->object; + } + + /** + * Provide list of fields in UrlInformation covered by this guesser. + * + * @return array + */ + protected function getFields() + { + return ['depth']; + } + + /** + * Method to extract mock building. + * + * @param string $contentBasePath + */ + private function buildMocks($contentBasePath = '/cms/test') + { + $this->managerRegistry = $this->createMock(ManagerRegistry::class); + $this->documentManager = $this->createMock(DocumentManager::class); + $this->node = $this->createMock(NodeInterface::class); + $this->object = new \stdClass(); + $this->guesser = new DepthGuesser($this->managerRegistry, $contentBasePath); + } } diff --git a/tests/Unit/Sitemap/GuesserTestCase.php b/tests/Unit/Sitemap/GuesserTestCase.php index 51e824f6..39986255 100644 --- a/tests/Unit/Sitemap/GuesserTestCase.php +++ b/tests/Unit/Sitemap/GuesserTestCase.php @@ -1,9 +1,11 @@ assertEquals('2016-07-06T00:00:00+02:00', $urlInformation->getLastModification()); } + public function testGuessNoOverwrite() + { + $urlInformation = new UrlInformation(); + $urlInformation->setLastModification(new \DateTime('2016-06-06', new \DateTimeZone('Europe/Berlin'))); + + $this->guesser->guessValues($urlInformation, $this->data, 'default'); + $this->assertEquals('2016-06-06T00:00:00+02:00', $urlInformation->getLastModification()); + } + /** * Create the guesser for this test. * @@ -103,13 +114,4 @@ protected function getFields() { return ['LastModification']; } - - public function testGuessNoOverwrite() - { - $urlInformation = new UrlInformation(); - $urlInformation->setLastModification(new \DateTime('2016-06-06', new \DateTimeZone('Europe/Berlin'))); - - $this->guesser->guessValues($urlInformation, $this->data, 'default'); - $this->assertEquals('2016-06-06T00:00:00+02:00', $urlInformation->getLastModification()); - } } diff --git a/tests/Unit/Sitemap/LocationGuesserTest.php b/tests/Unit/Sitemap/LocationGuesserTest.php index 26b2c051..5444d76e 100644 --- a/tests/Unit/Sitemap/LocationGuesserTest.php +++ b/tests/Unit/Sitemap/LocationGuesserTest.php @@ -1,9 +1,11 @@ Date: Wed, 27 Feb 2019 06:52:42 +0100 Subject: [PATCH 21/27] fix type in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d2e18d38..784c2e8c 100644 --- a/composer.json +++ b/composer.json @@ -43,7 +43,7 @@ "symfony-cmf/routing-bundle": "To make use of the alternate locale provider.", "doctrine/phpcr-bundle": "To persist the metadata in PHPCR ODM documents", "doctrine/doctrine-bundle": "To persist the metadata in ORM entities", - "doctrine/orm": "To persist the metadata in ORM entities, ~2.4", + "doctrine/orm": "To persist the metadata in ORM entities, ^2.4", "burgov/key-value-form-bundle": "To have advanced editing options in the SEO form type, ^1.0", "symfony-cmf/sonata-admin-integration-bundle": "To provide an admin interface for the PHPCR ODM documents." }, From 42926e97dc4de64adcb3f2c3627843a34413b36f Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Wed, 27 Feb 2019 08:49:16 +0100 Subject: [PATCH 22/27] revert changes in travis as they are not correct here in testing component --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd338d06..a85990d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,10 +62,10 @@ before_install: - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) -install: - - if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi; +install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS -script: make $TARGET +script: + - if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi after_success: - if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; From c3f3e510305d6a6b32a26834a2b34e64b3fa3b32 Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Wed, 27 Feb 2019 08:51:56 +0100 Subject: [PATCH 23/27] revert all changes from dev-kit in travis.yml --- .travis.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a85990d8..1ba875f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,7 +37,6 @@ env: matrix: include: - - env: TARGET=lint - php: 7.3 env: STABILITY="dev" SYMFONY_VERSION=4.3.* - php: 7.3 @@ -67,8 +66,6 @@ install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS script: - if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi -after_success: - - if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; notifications: irc: "irc.freenode.org#symfony-cmf" From 915f8c95179d8630382076817c238b5b88a778fe Mon Sep 17 00:00:00 2001 From: ElectricMaxxx Date: Wed, 27 Feb 2019 08:56:29 +0100 Subject: [PATCH 24/27] revert falsy change --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1ba875f9..bd338d06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,7 @@ env: matrix: include: + - env: TARGET=lint - php: 7.3 env: STABILITY="dev" SYMFONY_VERSION=4.3.* - php: 7.3 @@ -61,11 +62,13 @@ before_install: - if [ "$SYMFONY_VERSION" != "" ]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-update; fi - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) -install: travis_wait composer update --prefer-dist $COMPOSER_FLAGS +install: + - if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi; -script: - - if [ "${TEST_INSTALLATION}" == true ]; then make test_installation; else make test; fi +script: make $TARGET +after_success: + - if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; notifications: irc: "irc.freenode.org#symfony-cmf" From 04163c63cf94abaea036afa6314c65635ec30e27 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Thu, 28 Feb 2019 20:27:44 +0100 Subject: [PATCH 25/27] fix changelog entry --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d44443..485ea6d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,7 @@ Changelog 2.2.0 (unreleased) ------------------ -* **2015-02-26**:introduce PHPCS for style checks again -* **2015-02-26**: Symfony 4.2 combustibility verified through tests, Symfony 4.3 allowed to break but on watch in tests -* **2015-02-26**: drop Symfony 2.8 support -* **2015-02-26**: make use of PHPUnit 6 +* **2019-02-28**: Symfony 4.2 support without warnings 2.1.0 ----- From 81a7a0e179c13ee870cac76a2d1e7fb55b6d9031 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 1 Mar 2019 15:47:44 +0100 Subject: [PATCH 26/27] DevKit updates --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bd338d06..58e7ced2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,8 +31,8 @@ env: global: - SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - - SYMFONY_PHPUNIT_VERSION=6 - - PHPUNIT_VERSION=6 + - SYMFONY_PHPUNIT_VERSION=7 + - PHPUNIT_VERSION=7 - TARGET=test matrix: From 198e741949c9aabe5d233f04c4888d00b8685423 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 1 Mar 2019 23:19:47 +0100 Subject: [PATCH 27/27] use higher symfony dependency/config testing versions --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 784c2e8c..0cb11756 100644 --- a/composer.json +++ b/composer.json @@ -25,8 +25,8 @@ "doctrine/orm": "^2.4", "symfony-cmf/core-bundle": "^2.1", "symfony-cmf/routing-bundle": "^1.4.0 || ^2.1", - "matthiasnoback/symfony-dependency-injection-test": "^2.3.1", - "matthiasnoback/symfony-config-test": "^3.1.1", + "matthiasnoback/symfony-dependency-injection-test": "^3.1", + "matthiasnoback/symfony-config-test": "^4.0.1", "symfony/phpunit-bridge": "^4.2.2", "burgov/key-value-form-bundle": "^1.0", "symfony-cmf/testing": "^2.1.9",