Download the PHP package webignition/symfony-test-service-injector-trait without Composer
On this page you can find all versions of the php package webignition/symfony-test-service-injector-trait. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download webignition/symfony-test-service-injector-trait
More information about webignition/symfony-test-service-injector-trait
Files in webignition/symfony-test-service-injector-trait
Download webignition/symfony-test-service-injector-trait
More information about webignition/symfony-test-service-injector-trait
Files in webignition/symfony-test-service-injector-trait
Vendor webignition
Package symfony-test-service-injector-trait
Short Description Inject Symfony services into test class properties
License MIT
Homepage https://github.com/webignition/symfony-test-service-injector-trait
Package symfony-test-service-injector-trait
Short Description Inject Symfony services into test class properties
License MIT
Homepage https://github.com/webignition/symfony-test-service-injector-trait
Please rate this library. Is it a good library?
Informations about the package symfony-test-service-injector-trait
Inject Symfony Services Into Test Class Properties
A trait to use in your Symfony tests to populate test class properties with their services from the container.
How to Use It
use TestClassServicePropertyInjectorTrait
in any test that extendsSymfony\Bundle\FrameworkBundle\Test\KernelTestCase
- call
$this->injectContainerServicesIntoClassProperties()
in yoursetUp()
method
What It Does
Sets all private and protected properties to their respective services. For a property to be set it must:
- be
private
orprotected
- be type-hinted to a non-scalar type
- have a type hint that matches a service in the container
Usage Example
Before-and-after Comparison
Before
After
All versions of symfony-test-service-injector-trait with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4.0|^8
The package webignition/symfony-test-service-injector-trait contains the following files
Loading the files please wait ....