Giter Club home page Giter Club logo

Comments (3)

matthiasnoback avatar matthiasnoback commented on August 15, 2024

Thanks for submitting this issue. However, I don't think this is a good use case: if you know that a service definition should have a parameter as its class, you should assert exactly that.
Besides, writing unit tests for a container extension is about verifying that its load() method does what it should do (e.g. load some services, set some parameters, modify existing ones, etc.). Validating the eventual consistency of the service definitions in the end should be done by a functional test (or by https://github.com/matthiasnoback/symfony-service-definition-validator).
Using parameters for service classes is something the framework itself does most of the time. I don't really encourage it. It clutters the dumped container with many parameters that are never used at runtime. Parameters should only be used for classes when they are likely to be changed by some other bundle. Then that bundle does not need to call getDefinition(...)->setClass(...) but instead can simply change the value of the parameter.

from symfonydependencyinjectiontest.

h4cc avatar h4cc commented on August 15, 2024

Thanks for your point of view. If parameter for classes should be used or not may not be my intention for a topic of this issue.
Anyhow, if anybody likes the shortcut, they can copy it from my first post.

How about waiting for other opinions about such a shortcut?

from symfonydependencyinjectiontest.

matthiasnoback avatar matthiasnoback commented on August 15, 2024

Alright, though I'll close this issue for now, in order to clear my view on pending issues. Thanks again!

from symfonydependencyinjectiontest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.