Skip to content

Overriding services for functional testing #8203

@chalasr

Description

@chalasr

Next to symfony/symfony#23311

Some people are used to set() a service in the container for mocking it in functional tests (see https://stackoverflow.com/a/19726963/4363634) but as of 3.3, setting/resetting a predefined service is deprecated.

The right solution is to load testing specific config (symfony/symfony#21533 (comment)).
I think we should add an example to the docs.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    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