Skip to content

PHPUnit tests don't detect deprecations appear during container initialization #24767

@ossinkine

Description

@ossinkine
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3

For example YAML configuration contains deprecations, f.e. config_dev.yml contains non-escaped expressions:

monolog:
    handlers:
        main:
            type: stream
            path: %kernel.logs_dir%/%kernel.environment%.log
            level: debug
            channels: [!event]
        console:
            type: console
            process_psr_3_messages: false
            channels: [!event, !doctrine, !console]

In the web panel you can see notices like Using the unquoted scalar value "!event" is deprecated since version 3.3 and will be considered as a tagged value in 4.0.. But when you run functional tests there are no notices, tests are passed. You can only see serialized deprecations in the var/cache/test/appTestDebugProjectContainerDeprecations.log. It happens because errors are caught at https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Kernel.php#L464 and previous PHPUnit Bridge handler is not called.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy