Comments (3)
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.
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.
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)
- failed to load vendor/autoload.php HOT 1
- LoaderFactory supporting .yaml extension
- Incompatibility with phpunit 8 HOT 2
- $container->getExtensionConfig() does not return minimal configuration
- Support for Symfony 5 HOT 3
- Assert container does not have a method call
- Lots of composer deprecation warnings about PSR-4 compliance HOT 2
- PHP8 Support HOT 1
- New release HOT 1
- False positive with assertContainerBuilderHasServiceDefinitionWithArgument
- Remove supported for Symfony 2.3 HOT 5
- Allow test DI-extenions that depends on another extensions and config
- it_lower_cases_aliased_service_ids fails HOT 2
- Next release HOT 1
- Add support for Symfony 4
- Investigate in build failure HOT 2
- Support tests for "Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface" HOT 1
- Add phpunit as a non-dev depedency. HOT 2
- 1.2.0 is not BC with 1.1.* HOT 3
- Declaration of Matthias\SymfonyDependencyInjectionTest\PhpUnit\DefinitionHasMethodCallConstraint::toString() must be compatible with PHPUnit\Framework\SelfDescribing::toString(): string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symfonydependencyinjectiontest.