Download the PHP package ramunasd/symfony-container-mocks without Composer
On this page you can find all versions of the php package ramunasd/symfony-container-mocks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package symfony-container-mocks
# Symfony Container Mocks
This container enables you to mock services in the Symfony dependency injection container. It is particularly useful in functional tests.
Features
- Can replace any Symfony service or parameter
- Automatically detects service class from service definition
- Can be used with any mocking framework
- Compatible with Symfony versions 2.7 - 3.4
- Works on all supported version of PHP
OTB supported mocking frameworks
Installation
Add SymfonyContainerMocks using composer:
composer require "ramunasd/symfony-container-mocks"
or edit your composer.json:
Replace base container class for test environment in app/AppKernel.php
And clear application cache.
Examples
Inject mocked service
Inject automatically mocked service
feature works only with flag "debug" enabled.
Other mocking frameworks
Set specific framework parameter
Things TO DO
- Symfony 4.x support
- PSR-11 adoption
Similar/Related projects
- https://github.com/jakzal/phpunit-injector - inject Symfony services into PHPUnit test cases
All versions of symfony-container-mocks with dependencies
PHP Build Version
Package Version
The package ramunasd/symfony-container-mocks contains the following files
Loading the files please wait ....