Home > other >  Enable depreciations with phpunit bridge
Enable depreciations with phpunit bridge

Time:09-28

I want upgrading my symfony 2.8, I would like to have the list of deprecations for my project. so I installed phpunit-bridge to run my unit tests. However, phpunit does not return any deprecation information to me. The documentation does not specify a parameter to enable its notifications. Has anyone ever encountered this problem?

  "require": {
    "php": ">=5.6",
    "symfony/symfony": "2.8.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "^3.3",
    "sensio/distribution-bundle": "~5.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "doctrine/doctrine-migrations-bundle": "^1.2.1",
    "khepin/yaml-fixtures-bundle": "dev-master",
    "lexik/jwt-authentication-bundle": "2.1.*",
    "gregwar/image-bundle": "dev-master",
    "stof/doctrine-extensions-bundle": "^1.3",
    "misd/phone-number-bundle": "^1.1",
    "nelmio/api-doc-bundle": "^2.13",
    "simplethings/entity-audit-bundle": "^1.0",
    "liuggio/excelbundle": "^2.1",
    "beberlei/doctrineextensions": "^1.0",
    "gesdinet/jwt-refresh-token-bundle": "^0.2.0",
    "jms/serializer-bundle": "^2.0",
    "friendsofsymfony/rest-bundle": "^2.2",
    "nelmio/cors-bundle": "~1.4",
    "symfony/assetic-bundle": "^2.8",
    "evence/soft-deleteable-extension-bundle": "^1.3",
    "gregwar/captcha-bundle": "^2.0",
    "gedmo/doctrine-extensions": "^2.4",
    "twig/twig": "2.6.*",
    "symfony/phpunit-bridge": "5.1.7"
},
"repositories": [
    {
        "type": "git",
    }
],
"require-dev": {
    "sensio/generator-bundle": "~3.0"
},

this is my config file for phpunit

<php>
    <ini name="error_reporting" value="-1" />
    <!--
        <server name="KERNEL_DIR" value="/path/to/your/app/" />
    -->
    <env name="SYMFONY_DEPRECATIONS_HELPER" value="strict" />
</php>

<testsuites>
    <testsuite name="Project Test Suite">
        <directory>../src/test/NotifBundle</directory>
        <directory>../src/Tests/Controller/ContractRESTControllerTest.php</directory>
        <directory>../src/test/ContractBundle/Tests</directory>

    </testsuite>
</testsuites>

CodePudding user response:

You forgot to add the listener that captures the deprecation messages and later on displays them to your phpunit.xml, for example through

<listeners>
    <listener  />
</listeners>

Source: Installation steps from the Symfony documentation

  • Related