From f7fca01a5a9faacf5de86e397e2659c669093749 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Tue, 29 Jan 2019 07:00:23 +0100 Subject: [PATCH 1/8] DevKit updates --- .travis.yml | 25 +++++++++---------- Makefile | 3 +-- README.md | 49 +++++++++++++++++++++----------------- composer.json | 8 +++---- src/Resources/meta/LICENSE | 2 +- 5 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2013814..9279df7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,28 +26,25 @@ cache: - $HOME/.composer/cache/files env: - matrix: SYMFONY_VERSION=4.0.* + matrix: SYMFONY_VERSION=4.2.* global: - - SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" + - SYMFONY_DEPRECATIONS_HELPER="weak" - SYMFONY_PHPUNIT_DIR=.phpunit SYMFONY_PHPUNIT_REMOVE="symfony/yaml" - KERNEL_CLASS=Symfony\Cmf\Bundle\ResourceBundle\Tests\Fixtures\App\Kernel - - SYMFONY_PHPUNIT_VERSION=5.7 - - TEST_INSTALLATION=false + - SYMFONY_PHPUNIT_VERSION=5.7.26 matrix: include: - - php: 7.2 - env: SYMFONY_VERSION=4.0.* - - php: 7.1 - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=2.8.* SYMFONY_DEPRECATIONS_HELPER=weak - - php: 7.2 - env: SYMFONY_VERSION=3.3.* - - php: 7.2 - env: SYMFONY_VERSION=3.4.* - - env: TEST_INSTALLATION=true + - php: "7.3" + env: STABILITY="dev" SYMFONY_VERSION="4.2.*" + - php: "7.2" + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION="3.4.*" SYMFONY_DEPRECATIONS_HELPER="weak" + - php: "7.3" + env: STABILITY="dev" SYMFONY_VERSION="4.0.*" + - php: "7.3" + env: STABILITY="dev" SYMFONY_VERSION="4.1.*" fast_finish: true allow_failures: - - env: TEST_INSTALLATION=true before_install: - phpenv config-rm xdebug.ini || true diff --git a/Makefile b/Makefile index a9e461f..cd8a740 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,9 @@ list: @echo 'unit_tests: will run unit tests only' @echo 'functional_tests_phpcr: will run functional tests with PHPCR' - @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/test_installation.mk .PHONY: test test: unit_tests functional_tests_phpcr diff --git a/README.md b/README.md index d80fa4c..37dc01b 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,13 @@ [![Monthly Downloads](https://poser.pugx.org/symfony-cmf/resource-bundle/d/monthly)](https://packagist.org/packages/symfony-cmf/resource-bundle) [![Daily Downloads](https://poser.pugx.org/symfony-cmf/resource-bundle/d/daily)](https://packagist.org/packages/symfony-cmf/resource-bundle) -Branch | Travis | Coveralls | ------- | ------ | --------- | -master | [![Build Status][travis_unstable_badge]][travis_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] | +Branch | Travis | Coveralls | Scrutinizer | +------ | ------ | --------- | ----------- | +1.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] | +2.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). This bundle provides *object* resource location services based on Puli. @@ -36,24 +38,24 @@ provide the context with which to resolve the documents. ## Requirements -* PHP 7.1 / 7.2 -* Symfony 2.8 / 3.3 / 3.4 / 4.0 +* PHP 7.2 / 7.3 +* Symfony 3.4 / 4.0 / 4.1 / 4.2 * See also the `require` section of [composer.json](composer.json) ## Documentation For the install guide and reference, see: -* [symfony-cmf/resource-bundle Documentation](http://symfony.com/doc/master/cmf/bundles/resource-rest/index.html) +* [symfony-cmf/resource-bundle Documentation](https://symfony.com/doc/master/cmf/bundles/resource-rest/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 @@ -62,7 +64,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 @@ -72,14 +74,17 @@ Thanks to This package is available under the [MIT license](src/Resources/meta/LICENSE). -[travis_legacy_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=master -[travis_stable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=master -[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=master -[travis_link]: https://travis-ci.org/symfony-cmf/resource-bundle - -[coveralls_legacy_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=master -[coveralls_legacy_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=master -[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=master -[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=master -[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=master -[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=master +[travis_stable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=1.1 +[travis_stable_link]: https://travis-ci.org/symfony-cmf/resource-bundle +[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=2.0-dev +[travis_unstable_link]: https://travis-ci.org/symfony-cmf/resource-bundle + +[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=1.1 +[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=1.1 +[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=2.0-dev +[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=2.0-dev + +[scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/badges/quality-score.png?b=1.1 +[scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/?branch=1.1 +[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/badges/quality-score.png?b=2.0-dev +[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/?branch=2.0-dev diff --git a/composer.json b/composer.json index c14b037..99cfe95 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ } ], "require": { - "php": "^7.1", - "symfony/framework-bundle": "^2.8 || ^3.3 || ^4.0", - "symfony/options-resolver": "^2.8 || ^3.3 || ^4.0", + "php": "^7.2", + "symfony/framework-bundle": "^3.4 || ^4.0", + "symfony/options-resolver": "^3.4 || ^4.0", "symfony-cmf/resource": "^1.0" }, "require-dev": { "symfony-cmf/testing": "^2.1.8", - "symfony/phpunit-bridge": "^3.3 || ^4.0", + "symfony/phpunit-bridge": "^3.4 || ^4.0", "doctrine/phpcr-odm": "^1.4|^2.0" }, "suggest": { diff --git a/src/Resources/meta/LICENSE b/src/Resources/meta/LICENSE index 99f8144..908363a 100644 --- a/src/Resources/meta/LICENSE +++ b/src/Resources/meta/LICENSE @@ -1,4 +1,4 @@ -Symfony Cmf Resource Bundle +Symfony CMF Resource Bundle The MIT License From aa0057bd3d0288f37370ecfa0e24e303c92c0607 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Wed, 30 Jan 2019 23:43:14 +0100 Subject: [PATCH 2/8] DevKit updates --- .travis.yml | 26 +++++++++++++------------- Makefile | 7 ++++++- README.md | 14 +++++++------- composer.json | 4 ++-- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9279df7..ccd7001 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,22 @@ 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\ResourceBundle\Tests\Fixtures\App\Kernel - - SYMFONY_PHPUNIT_VERSION=5.7.26 + - SYMFONY_PHPUNIT_VERSION=6 + - TEST_INSTALLATION=false matrix: include: - - php: "7.3" - env: STABILITY="dev" SYMFONY_VERSION="4.2.*" - - php: "7.2" - env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION="3.4.*" SYMFONY_DEPRECATIONS_HELPER="weak" - - php: "7.3" - env: STABILITY="dev" SYMFONY_VERSION="4.0.*" - - php: "7.3" - env: STABILITY="dev" SYMFONY_VERSION="4.1.*" + - 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.* fast_finish: true - allow_failures: before_install: - phpenv config-rm xdebug.ini || true diff --git a/Makefile b/Makefile index cd8a740..5725e10 100644 --- a/Makefile +++ b/Makefile @@ -14,13 +14,18 @@ ############################################################################ 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} endif PACKAGE=symfony-cmf/resource-bundle -export KERNEL_CLASS=Symfony\Cmf\Bundle\ResourceBundle\Tests\Fixtures\App\Kernel + list: @echo 'test: will run all tests' @echo 'unit_tests: will run unit tests only' diff --git a/README.md b/README.md index 37dc01b..5ddda74 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Branch | Travis | Coveralls | Scrutinizer | ------ | ------ | --------- | ----------- | 1.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] | -2.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] | +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 @@ -38,7 +38,7 @@ provide the context with which to resolve the documents. ## 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) @@ -76,15 +76,15 @@ This package is available under the [MIT license](src/Resources/meta/LICENSE). [travis_stable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=1.1 [travis_stable_link]: https://travis-ci.org/symfony-cmf/resource-bundle -[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=2.0-dev +[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/resource-bundle.svg?branch=dev-master [travis_unstable_link]: https://travis-ci.org/symfony-cmf/resource-bundle [coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=1.1 [coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=1.1 -[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=2.0-dev -[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=2.0-dev +[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource-bundle/badge.svg?branch=dev-master +[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/resource-bundle?branch=dev-master [scrutinizer_stable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/badges/quality-score.png?b=1.1 [scrutinizer_stable_link]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/?branch=1.1 -[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/badges/quality-score.png?b=2.0-dev -[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/?branch=2.0-dev +[scrutinizer_unstable_badge]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/badges/quality-score.png?b=dev-master +[scrutinizer_unstable_link]: https://scrutinizer-ci.com/g/symfony-cmf/resource-bundle/?branch=dev-master diff --git a/composer.json b/composer.json index 99cfe95..a1d4825 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ } ], "require": { - "php": "^7.2", + "php": "^7.1", "symfony/framework-bundle": "^3.4 || ^4.0", "symfony/options-resolver": "^3.4 || ^4.0", "symfony-cmf/resource": "^1.0" }, "require-dev": { "symfony-cmf/testing": "^2.1.8", - "symfony/phpunit-bridge": "^3.4 || ^4.0", + "symfony/phpunit-bridge": "^4.2.2", "doctrine/phpcr-odm": "^1.4|^2.0" }, "suggest": { From 9c9e1793ea06e496aea0506daf77606f2c481d7f Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Fri, 1 Mar 2019 16:54:27 +0100 Subject: [PATCH 3/8] DevKit updates --- .php_cs.dist | 64 +++++++++++++++++++++++++++++++++++ .styleci.yml | 2 +- .travis.yml | 25 ++++++++------ .travis/after_success_test.sh | 5 +++ .travis/install_lint.sh | 11 ++++++ .travis/install_test.sh | 19 +++++++++++ Makefile | 58 +++++++++++++++++++++++++------ README.md | 2 +- composer.json | 4 +-- phpunit.xml.dist | 41 +++++++++++++--------- src/Resources/meta/LICENSE | 2 +- 11 files changed, 192 insertions(+), 41 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 0000000..5759af5 --- /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/.styleci.yml b/.styleci.yml index 2bdb04b..c721eb6 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 ccd7001..933305a 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. # @@ -29,19 +29,20 @@ 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 + - SYMFONY_PHPUNIT_VERSION=7 + - PHPUNIT_VERSION=7 + - TARGET=test matrix: include: + - env: TARGET=lint - 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.* + env: COMPOSER_FLAGS="--prefer-lowest" SYMFONY_VERSION=3.4.* SYMFONY_DEPRECATIONS_HELPER="/.*each.*/" + - php: 7.2 env: SYMFONY_VERSION=4.1.* fast_finish: true @@ -54,9 +55,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 0000000..9837420 --- /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 0000000..864c751 --- /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 0000000..a033500 --- /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 5725e10..8c42abe 100644 --- a/Makefile +++ b/Makefile @@ -7,33 +7,71 @@ ############################################################################ # 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. # ############################################################################ 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} endif PACKAGE=symfony-cmf/resource-bundle +HAS_XDEBUG=$(shell php --modules|grep --quiet xdebug;echo $$?) 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' - -include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk -include ${TESTING_SCRIPTS_DIR}/make/functional_tests_phpcr.mk +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 .PHONY: test -test: unit_tests functional_tests_phpcr +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 + +lint-php: + php-cs-fixer fix --ansi --verbose --diff --dry-run +.PHONY: lint-php + +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 $@ +endif diff --git a/README.md b/README.md index 5ddda74..e6ffc4a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ provide the context with which to resolve the documents. ## 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 a1d4825..c118cae 100644 --- a/composer.json +++ b/composer.json @@ -11,8 +11,8 @@ ], "require": { "php": "^7.1", - "symfony/framework-bundle": "^3.4 || ^4.0", - "symfony/options-resolver": "^3.4 || ^4.0", + "symfony/framework-bundle": "^3.4 || ^4.1", + "symfony/options-resolver": "^3.4 || ^4.1", "symfony-cmf/resource": "^1.0" }, "require-dev": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 218721f..ba7feb0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,27 +1,36 @@ + + colors="true" + bootstrap="vendor/symfony-cmf/testing/bootstrap/bootstrap.php" +> - - + + + + ./tests/Unit - + ./tests/Functional + ./tests/Functional/Doctrine/Orm - + + + + + + src/ + + Resources/ + + + + + - - - src/ - - *Bundle.php - Resources/ - - - + + diff --git a/src/Resources/meta/LICENSE b/src/Resources/meta/LICENSE index 908363a..b8106e1 100644 --- a/src/Resources/meta/LICENSE +++ b/src/Resources/meta/LICENSE @@ -2,7 +2,7 @@ Symfony CMF Resource 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 f492d69f984e9e44f066d4d562978cf9d8fe7715 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Sat, 2 Mar 2019 00:43:41 +0100 Subject: [PATCH 4/8] cs fixes for php, adjusting travis config --- .gitignore | 2 ++ .travis.yml | 8 ++++- composer.json | 2 +- src/CmfResourceBundle.php | 4 ++- .../CmfResourceExtension.php | 30 ++++++++++--------- .../Compiler/DescriptionEnhancerPass.php | 6 ++-- src/DependencyInjection/Configuration.php | 10 ++++--- .../Factory/DoctrinePhpcrOdmFactory.php | 4 ++- .../Repository/Factory/FilesystemFactory.php | 4 ++- .../Repository/Factory/PhpcrFactory.php | 4 ++- .../Factory/RepositoryFactoryInterface.php | 4 ++- src/Registry/RepositoryRegistry.php | 8 +++-- src/Twig/DescriptionExtension.php | 4 ++- tests/Functional/FilesystemRepositoryTest.php | 4 ++- tests/Functional/PhpcrOdmRepositoryTest.php | 4 ++- tests/Functional/PhpcrRepositoryTest.php | 4 ++- tests/Functional/PhpcrRepositoryTestCase.php | 14 +++++---- tests/Functional/RepositoryTestCase.php | 4 ++- .../CmfResourceExtensionTest.php | 14 +++++---- .../Compiler/DescriptionEnhancerPassTest.php | 30 ++++++++++--------- .../DependencyInjection/ConfigurationTest.php | 6 ++-- .../Factory/DoctrinePhpcrOdmFactoryTest.php | 4 ++- .../Repository/Factory/FactoryTestCase.php | 6 ++-- .../Factory/FilesystemFactoryTest.php | 10 ++++--- .../Repository/Factory/PhpcrFactoryTest.php | 4 ++- .../Unit/Registry/RepositoryRegistryTest.php | 28 +++++++++-------- tests/Unit/Twig/DescriptionExtensionTest.php | 6 ++-- 27 files changed, 142 insertions(+), 86 deletions(-) diff --git a/.gitignore b/.gitignore index 7463ccd..26f4ff0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ tests/Fixtures/App/var/ !tests/Fixtures/App/var/.gitempty composer.lock vendor +build +.php_cs.cache diff --git a/.travis.yml b/.travis.yml index 933305a..fc1a125 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,14 +38,20 @@ env: matrix: include: - env: TARGET=lint + - 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="/.*each.*/" - - php: 7.2 env: SYMFONY_VERSION=4.1.* + - env: TARGET=test_installation fast_finish: true + allow_failures: + - php: 7.3 + env: STABILITY="dev" SYMFONY_VERSION=4.3.* + - env: TARGET=test_installation before_install: - phpenv config-rm xdebug.ini || true diff --git a/composer.json b/composer.json index c118cae..98d7e04 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require-dev": { "symfony-cmf/testing": "^2.1.8", "symfony/phpunit-bridge": "^4.2.2", - "doctrine/phpcr-odm": "^1.4|^2.0" + "doctrine/phpcr-odm": "^1.4 || ^2.0" }, "suggest": { "doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents (^1.3)", diff --git a/src/CmfResourceBundle.php b/src/CmfResourceBundle.php index 71873ea..fcdf7a0 100644 --- a/src/CmfResourceBundle.php +++ b/src/CmfResourceBundle.php @@ -1,9 +1,11 @@ loadRepositories($container, $config['repositories'], $config['default_repository']); } + public function addRepositoryFactory($name, RepositoryFactoryInterface $factory) + { + $this->repositoryFactories[$name] = $factory; + } + + /** + * {@inheritdoc} + */ + public function getNamespace() + { + return 'http://cmf.symfony.com/schema/dic/cmf_resource'; + } + private function loadRepositories(ContainerBuilder $container, array $configs, $defaultRepositoryName) { $repositoryTypes = array_keys($this->repositoryFactories); @@ -98,17 +113,4 @@ private function loadRepositories(ContainerBuilder $container, array $configs, $ $registry->replaceArgument(1, $serviceMap); $registry->replaceArgument(2, $typeMap); } - - public function addRepositoryFactory($name, RepositoryFactoryInterface $factory) - { - $this->repositoryFactories[$name] = $factory; - } - - /** - * {@inheritdoc} - */ - public function getNamespace() - { - return 'http://cmf.symfony.com/schema/dic/cmf_resource'; - } } diff --git a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php index c8bac89..75b1bf5 100644 --- a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php +++ b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php @@ -1,9 +1,11 @@ addDefaultsIfNotSet() ->beforeNormalization() ->ifTrue(function ($n) { - return is_array($n) && !isset($n['options']) && !isset($n['option']); + return \is_array($n) && !isset($n['options']) && !isset($n['option']); }) ->then(function ($n) { $options = []; @@ -68,13 +70,13 @@ public function getConfigTreeBuilder() ->arrayNode('options') ->beforeNormalization() ->ifTrue(function ($n) { - return is_array($n) && 0 !== count(array_filter($n, function ($i) { + return \is_array($n) && 0 !== \count(array_filter($n, function ($i) { return isset($i['collection']); })); }) ->then(function ($n) { foreach ($n as $id => $item) { - if (!is_array($item) || !isset($item['collection'])) { + if (!\is_array($item) || !isset($item['collection'])) { continue; } diff --git a/src/DependencyInjection/Repository/Factory/DoctrinePhpcrOdmFactory.php b/src/DependencyInjection/Repository/Factory/DoctrinePhpcrOdmFactory.php index 7b04bba..9e5e415 100644 --- a/src/DependencyInjection/Repository/Factory/DoctrinePhpcrOdmFactory.php +++ b/src/DependencyInjection/Repository/Factory/DoctrinePhpcrOdmFactory.php @@ -1,9 +1,11 @@ typeMap[$class])) { throw new \RuntimeException(sprintf( 'Repository of class "%s" is not known, could not determine its type.', diff --git a/src/Twig/DescriptionExtension.php b/src/Twig/DescriptionExtension.php index 87db11c..9f47875 100644 --- a/src/Twig/DescriptionExtension.php +++ b/src/Twig/DescriptionExtension.php @@ -1,9 +1,11 @@ baseNode->addNode('node-2'); $this->session->save(); - $expectedNbMoved = count($expectedPaths); + $expectedNbMoved = \count($expectedPaths); $nbMoved = $this->getRepository()->move($sourcePath, $targetPath); $this->assertEquals($expectedNbMoved, $nbMoved); @@ -144,7 +146,7 @@ public function testRemove($path, $expectedRemovedPaths) $this->baseNode->addNode('node-2'); $this->session->save(); - $expectedNbRemoved = count($expectedRemovedPaths); + $expectedNbRemoved = \count($expectedRemovedPaths); $nbRemoved = $this->getRepository()->remove($path); $this->assertEquals($expectedNbRemoved, $nbRemoved); @@ -199,12 +201,12 @@ public function provideReorder() /** * It should throw an exception if the reorder index is less than zero. - * - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Reorder position cannot be negative, got: -5 */ public function testReorderNegative() { + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Reorder position cannot be negative, got: -5'); + $this->getRepository()->reorder('/foo', -5); } } diff --git a/tests/Functional/RepositoryTestCase.php b/tests/Functional/RepositoryTestCase.php index 81d70e3..d3e7d6e 100644 --- a/tests/Functional/RepositoryTestCase.php +++ b/tests/Functional/RepositoryTestCase.php @@ -1,9 +1,11 @@ prophesize(ResourceRepository::class); $this->extension->addRepositoryFactory('foobar', $this->repositoryFactory->reveal()); - $this->repositoryFactory->create([])->willReturn(new Definition(get_class($repository->reveal()))); + $this->repositoryFactory->create([])->willReturn(new Definition(\get_class($repository->reveal()))); $this->repositoryFactory->configure(Argument::type(OptionsResolver::class))->willReturn(null); } @@ -66,12 +68,12 @@ public function testLoadRegistry() /** * Repositories: It should throw an exception if an unknown type is specified. - * - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Unknown repository type "bar", known repository types: "foobar" */ public function testConfigRepositoryNoType() { + $this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown repository type "bar", known repository types: "foobar"'); + $this->extension->load([ [ 'repositories' => [ diff --git a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php index 63eee2e..62576be 100644 --- a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php @@ -1,9 +1,11 @@ expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('has no "alias" attribute'); + $this->container->has('cmf_resource.description.factory')->willReturn(true); $this->container->getParameter('cmf_resource.description.enabled_enhancers')->willReturn([ 'enhancer_1', @@ -82,12 +84,12 @@ public function testHasNoAlias() /** * It should throw an exception if two tags have the same alias. - * - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage has already been registered */ public function testDuplicatedAlias() { + $this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('has already been registered'); + $this->container->has('cmf_resource.description.factory')->willReturn(true); $this->container->getParameter('cmf_resource.description.enabled_enhancers')->willReturn([ 'enhancer_1', @@ -102,12 +104,12 @@ public function testDuplicatedAlias() /** * It should throw an exception if an unknown enhancer is enabled. - * - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Unknown description enhancer(s) "three" were enabled, available enhancers: "one", "two" */ public function testUnknownEnhancer() { + $this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown description enhancer(s) "three" were enabled, available enhancers: "one", "two"'); + $this->container->has('cmf_resource.description.factory')->willReturn(true); $this->container->getParameter('cmf_resource.description.enabled_enhancers')->willReturn([ 'three', @@ -122,12 +124,12 @@ public function testUnknownEnhancer() /** * It should throw an exception if an invalid tag attributes is used. - * - * @expectedException \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException - * @expectedExceptionMessage Unknown tag attributes "foobar" for service "service_1", valid attributes: "name", "alias", "priority */ public function testInvalidAttribute() { + $this->expectException(\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException::class); + $this->expectExceptionMessage('Unknown tag attributes "foobar" for service "service_1", valid attributes: "name", "alias", "priority'); + $this->container->has('cmf_resource.description.factory')->willReturn(true); $this->container->getParameter('cmf_resource.description.enabled_enhancers')->willReturn([ 'service_1', diff --git a/tests/Unit/DependencyInjection/ConfigurationTest.php b/tests/Unit/DependencyInjection/ConfigurationTest.php index efe2505..c4c016c 100644 --- a/tests/Unit/DependencyInjection/ConfigurationTest.php +++ b/tests/Unit/DependencyInjection/ConfigurationTest.php @@ -1,9 +1,11 @@ expectException(\Symfony\Component\OptionsResolver\Exception\MissingOptionsException::class); + $this->expectExceptionMessage('The required option "base_dir" is missing.'); + $this->buildContainer( $this->resolveOptions([ ]) diff --git a/tests/Unit/DependencyInjection/Repository/Factory/PhpcrFactoryTest.php b/tests/Unit/DependencyInjection/Repository/Factory/PhpcrFactoryTest.php index aa1ce52..38a4a14 100644 --- a/tests/Unit/DependencyInjection/Repository/Factory/PhpcrFactoryTest.php +++ b/tests/Unit/DependencyInjection/Repository/Factory/PhpcrFactoryTest.php @@ -1,9 +1,11 @@ expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Repository "barbar" has not been registered, available repositories: "test"'); + $registry = $this->createRegistry( [ 'test' => 'test_repository', @@ -65,12 +67,12 @@ public function testUnknownRepositoryName() /** * It should throw an exception if an name is requested for an unknown repository. - * - * @expectedException \RuntimeException - * @expectedExceptionMessage I don't know what its name is */ public function testGetNameUnknownRepository() { + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('I don\'t know what its name is'); + $registry = $this->createRegistry([]); $repository = $this->prophesize(ResourceRepository::class); @@ -79,12 +81,12 @@ public function testGetNameUnknownRepository() /** * It should throw an exception if a type is requsted for an unknown repository. - * - * @expectedException \RuntimeException - * @expectedExceptionMessage could not determine its type */ public function testGetTypeUnknownRepository() { + $this->expectException(\RuntimeException::class); + $this->expectExceptionMessage('could not determine its type'); + $registry = $this->createRegistry([]); $repository = $this->prophesize(ResourceRepository::class); @@ -131,9 +133,9 @@ private function createRegistry(array $serviceMap) $repository = $this->prophesize(ResourceRepository::class); $this->container->register( $serviceId, - get_class($repository->reveal()) + \get_class($repository->reveal()) ); - $typeMap[get_class($repository->reveal())] = 'test/type'; + $typeMap[\get_class($repository->reveal())] = 'test/type'; } return new RepositoryRegistry( diff --git a/tests/Unit/Twig/DescriptionExtensionTest.php b/tests/Unit/Twig/DescriptionExtensionTest.php index 13640b2..d2d3ec4 100644 --- a/tests/Unit/Twig/DescriptionExtensionTest.php +++ b/tests/Unit/Twig/DescriptionExtensionTest.php @@ -1,9 +1,11 @@ Date: Sun, 3 Mar 2019 03:27:38 +0100 Subject: [PATCH 5/8] fix tests --- .gitignore | 1 + composer.json | 9 +++++-- .../CmfResourceExtension.php | 26 ++++++++++++------- .../Compiler/DescriptionEnhancerPass.php | 2 +- .../Compiler/DescriptionEnhancerPassTest.php | 6 ++--- 5 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 26f4ff0..d6b12dd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ tests/Fixtures/App/var/ !tests/Fixtures/App/var/.gitempty composer.lock vendor +.phpunit build .php_cs.cache diff --git a/composer.json b/composer.json index 98d7e04..6e4e8e4 100644 --- a/composer.json +++ b/composer.json @@ -13,12 +13,17 @@ "php": "^7.1", "symfony/framework-bundle": "^3.4 || ^4.1", "symfony/options-resolver": "^3.4 || ^4.1", - "symfony-cmf/resource": "^1.0" + "symfony-cmf/resource": "^1.0", + "symfony/translation": "^3.4 || ^4.1", + "symfony/form": "^3.4 || ^4.1", + "symfony/templating": "^3.4 || ^4.1", + "symfony/validator": "^3.4 || ^4.1" }, "require-dev": { "symfony-cmf/testing": "^2.1.8", "symfony/phpunit-bridge": "^4.2.2", - "doctrine/phpcr-odm": "^1.4 || ^2.0" + "doctrine/phpcr-odm": "^1.4 || ^2.0", + "symfony/yaml": "^3.4 || ^4.1" }, "suggest": { "doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents (^1.3)", diff --git a/src/DependencyInjection/CmfResourceExtension.php b/src/DependencyInjection/CmfResourceExtension.php index 603655f..edc5a61 100644 --- a/src/DependencyInjection/CmfResourceExtension.php +++ b/src/DependencyInjection/CmfResourceExtension.php @@ -44,7 +44,7 @@ public function load(array $configs, ContainerBuilder $container) { $config = $this->processConfiguration(new Configuration(), $configs); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('resource.xml'); $loader->load('description.xml'); $loader->load('twig.xml'); @@ -76,11 +76,13 @@ private function loadRepositories(ContainerBuilder $container, array $configs, $ $type = $config['type']; if (!isset($this->repositoryFactories[$type])) { - throw new InvalidArgumentException(sprintf( - 'Unknown repository type "%s", known repository types: "%s"', - $type, - implode('", "', $repositoryTypes) - )); + throw new InvalidArgumentException( + sprintf( + 'Unknown repository type "%s", known repository types: "%s"', + $type, + implode('", "', $repositoryTypes) + ) + ); } $factory = $this->repositoryFactories[$type]; @@ -91,10 +93,14 @@ private function loadRepositories(ContainerBuilder $container, array $configs, $ try { $config = $optionsResolver->resolve($config['options']); } catch (\Exception $e) { - throw new InvalidArgumentException(sprintf( - 'Invalid configuration for repository "%s"', - $repositoryName - ), null, $e); + throw new InvalidArgumentException( + sprintf( + 'Invalid configuration for repository "%s"', + $repositoryName + ), + 0, + $e + ); } $serviceId = self::getRepositoryServiceId($repositoryName); diff --git a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php index 75b1bf5..875bdfd 100644 --- a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php +++ b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php @@ -57,7 +57,7 @@ public function process(ContainerBuilder $container) )); } - $priority = $attributes['priority'] ?? 0; + $priority = $attributes['priority'] ?? "0"; $enhancers[$name] = [$priority, new Reference($serviceId)]; } diff --git a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php index 62576be..153cbe1 100644 --- a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php @@ -155,9 +155,9 @@ public function testSortDescriptionEnhancers() ]); $this->container->findTaggedServiceIds('cmf_resource.description.enhancer')->willReturn([ 'service_1' => [['alias' => 'enhancer_1']], - 'service_2' => [['alias' => 'enhancer_2', 'priority' => 255]], - 'service_3' => [['alias' => 'enhancer_3', 'priority' => -250]], - 'service_4' => [['alias' => 'enhancer_4', 'priority' => -255]], + 'service_2' => [['alias' => 'enhancer_2', 'priority' => "255"]], + 'service_3' => [['alias' => 'enhancer_3', 'priority' => "-250"]], + 'service_4' => [['alias' => 'enhancer_4', 'priority' => "-255"]], ]); $this->container->getDefinition('cmf_resource.description.factory')->willReturn($this->factoryDefinition->reveal()); From 52890299d866f9017fe6105ef867b684f52f5d25 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Sun, 3 Mar 2019 03:28:30 +0100 Subject: [PATCH 6/8] some fixes through cs fix --- src/DependencyInjection/CmfResourceExtension.php | 2 +- .../Compiler/DescriptionEnhancerPass.php | 2 +- .../Compiler/DescriptionEnhancerPassTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DependencyInjection/CmfResourceExtension.php b/src/DependencyInjection/CmfResourceExtension.php index edc5a61..2c366e6 100644 --- a/src/DependencyInjection/CmfResourceExtension.php +++ b/src/DependencyInjection/CmfResourceExtension.php @@ -44,7 +44,7 @@ public function load(array $configs, ContainerBuilder $container) { $config = $this->processConfiguration(new Configuration(), $configs); - $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('resource.xml'); $loader->load('description.xml'); $loader->load('twig.xml'); diff --git a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php index 875bdfd..1946cc3 100644 --- a/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php +++ b/src/DependencyInjection/Compiler/DescriptionEnhancerPass.php @@ -57,7 +57,7 @@ public function process(ContainerBuilder $container) )); } - $priority = $attributes['priority'] ?? "0"; + $priority = $attributes['priority'] ?? '0'; $enhancers[$name] = [$priority, new Reference($serviceId)]; } diff --git a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php index 153cbe1..90dfede 100644 --- a/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php +++ b/tests/Unit/DependencyInjection/Compiler/DescriptionEnhancerPassTest.php @@ -155,9 +155,9 @@ public function testSortDescriptionEnhancers() ]); $this->container->findTaggedServiceIds('cmf_resource.description.enhancer')->willReturn([ 'service_1' => [['alias' => 'enhancer_1']], - 'service_2' => [['alias' => 'enhancer_2', 'priority' => "255"]], - 'service_3' => [['alias' => 'enhancer_3', 'priority' => "-250"]], - 'service_4' => [['alias' => 'enhancer_4', 'priority' => "-255"]], + 'service_2' => [['alias' => 'enhancer_2', 'priority' => '255']], + 'service_3' => [['alias' => 'enhancer_3', 'priority' => '-250']], + 'service_4' => [['alias' => 'enhancer_4', 'priority' => '-255']], ]); $this->container->getDefinition('cmf_resource.description.factory')->willReturn($this->factoryDefinition->reveal()); From 33adb09d4e74e67ecfcc80bcdd21e419c9f81edc Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Sun, 3 Mar 2019 03:36:34 +0100 Subject: [PATCH 7/8] DevKit updates --- .travis.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc1a125..933305a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,20 +38,14 @@ env: matrix: include: - env: TARGET=lint - - 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="/.*each.*/" + - php: 7.2 env: SYMFONY_VERSION=4.1.* - - env: TARGET=test_installation fast_finish: true - allow_failures: - - php: 7.3 - env: STABILITY="dev" SYMFONY_VERSION=4.3.* - - env: TARGET=test_installation before_install: - phpenv config-rm xdebug.ini || true From 4c495a2ee18861d792e8368bacfbfe86f8903261 Mon Sep 17 00:00:00 2001 From: electricmaxxx Date: Sun, 3 Mar 2019 03:38:16 +0100 Subject: [PATCH 8/8] DevKit updates --- .travis.yml | 2 ++ Makefile | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 933305a..f5b27da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,9 @@ matrix: - php: 7.2 env: SYMFONY_VERSION=4.1.* + - env: TARGET=test_installation fast_finish: true + - env: TARGET=test_installation before_install: - phpenv config-rm xdebug.ini || true diff --git a/Makefile b/Makefile index 8c42abe..3fb73b8 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ list: @echo 'unit_tests: will run unit tests only' @echo 'functional_tests_phpcr: will run functional tests with PHPCR' -TEST_DEPENDENCIES := "" + @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)) @@ -40,6 +40,11 @@ ifneq ($(strip $(EXTRA_INCLUDES)),) include $(EXTRA_INCLUDES) TEST_DEPENDENCIES := $(TEST_DEPENDENCIES)" functional_tests_phpcr" 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$