diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ec5bcbd..5f2c915 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -104,9 +104,12 @@ jobs: PIMCORE_INSTANCE_IDENTIFIER: ${{ secrets.PIMCORE_INSTANCE_IDENTIFIER }} PIMCORE_PRODUCT_KEY: ${{ secrets.PIMCORE_PRODUCT_KEY }} run: | + if [ "${{ matrix.dependencies }}" = "lowest" ]; then + export SYMFONY_DEPRECATIONS_HELPER=disabled + fi + if [ "${{ matrix.phpunit-version }}" = "^9.6" ]; then CONFIG="--configuration phpunit9.xml.dist" fi - # Ignore deprecations with "8191" = E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED - php -d error_reporting=8191 vendor/bin/phpunit --fail-on-risky ${CONFIG:-} + composer tests -- ${CONFIG:-} diff --git a/composer.json b/composer.json index 759cf5c..679faf7 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,8 @@ "phpstan/phpstan-phpunit": "^1.3.16", "phpstan/phpstan-symfony": "^1.3.8", "shipmonk/composer-dependency-analyser": "^1.7", - "symfony/http-foundation": "^6.4 || ^7.3" + "symfony/http-foundation": "^6.4 || ^7.3", + "symfony/phpunit-bridge": "^8.0" }, "conflict": { "pimcore/pimcore": ">=11.2.0 <11.2.2" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 3759a6c..3b82824 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,10 +4,16 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" beStrictAboutOutputDuringTests="true" + beStrictAboutChangesToGlobalState="true" bootstrap="tests/bootstrap.php" cacheDirectory=".phpunit.cache" colors="true" + failOnRisky="true" + failOnNotice="true" failOnWarning="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" > diff --git a/phpunit9.xml.dist b/phpunit9.xml.dist index 58a4578..c1f8591 100644 --- a/phpunit9.xml.dist +++ b/phpunit9.xml.dist @@ -7,12 +7,14 @@ bootstrap="tests/bootstrap.php" cacheResultFile=".phpunit.cache/test-results" colors="true" + failOnRisky="true" failOnWarning="true" > + @@ -30,4 +32,8 @@ + + + + diff --git a/tests/deprecation-baseline.txt b/tests/deprecation-baseline.txt new file mode 100644 index 0000000..08d8693 --- /dev/null +++ b/tests/deprecation-baseline.txt @@ -0,0 +1,16 @@ +# This file contains patterns to be ignored while testing for use of deprecated code. + +# Remaining "self" deprecation notices with Pimcore 11: +%Since symfony/framework-bundle 6\.4: The "annotations\.\w+" service is deprecated without replacement% + +# Remaining "direct" deprecation notices with Pimcore 11: +%Since symfony/serializer 6\.4: Passing a "Doctrine\\Common\\Annotations\\PsrCachedReader" instance as argument 1 to "Symfony\\Component\\Serializer\\Mapping\\Loader\\AttributeLoader::__construct\(\)" is deprecated, pass null or omit the parameter instead% +%Since symfony/validator 6\.4: Method "Symfony\\Component\\Validator\\ValidatorBuilder::setDoctrineAnnotationReader\(\)" is deprecated without replacement% +%Since symfony/routing 6\.4: Passing an instance of "Doctrine\\Common\\Annotations\\Reader" as first and the environment as second argument to "Symfony\\Component\\Routing\\Loader\\AttributeClassLoader::__construct" is deprecated\. Pass the environment as first argument instead% + +# Remaining "direct" deprecation notices with Pimcore 11 & 12: +%Since pimcore/skeleton 11\.2\.0: For consistency purpose, it is recommended to use the autoload from Symfony Runtime in project root "bin/console"% +%The "Pimcore\\Bundle\\InstallBundle\\Installer" class is considered internal\. It may change without further notice\. You should not use it from "Neusta\\Pimcore\\TestingFramework\\Database\\PimcoreInstaller"% + +# Remaining "direct" deprecation notices with Pimcore 12: +%Since pimcore/admin-ui-classic-bundle 2\.3: The AdminUiClassicBundle is deprecated and will be discontinued with Pimcore Studio%