Download the PHP package chaplean/unit-bundle without Composer
On this page you can find all versions of the php package chaplean/unit-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chaplean/unit-bundle
More information about chaplean/unit-bundle
Files in chaplean/unit-bundle
Package unit-bundle
Short Description Contains utilities for functional and unit tests
License MIT
Informations about the package unit-bundle
Getting Started With ChapleanUnitBundle
Prerequisites
This version of the bundle requires Symfony 2.8+.
Installation
1. Composer
2. AppKernel.php
Add
3. Import configuration
3.1. Import unit file config in config_test.yml
3.2. Configure mock (optional)
In config_test.yml
Example class:
3.3. Add parameter (optional)
Open app/config/parameters*
files
Add and change the default value. The false
value disable the loading of datafixtures.
Role Provider
You can use phpunit's to automaticaly run a test with a list of different values. We can use this to test a route against different roles with a single unit test. To acheive this we will need to
- list the roles and how to log as a user of that role
- create a dataProvider giving for each role the expectations we want (usually a http code)
- write the test using the @dataProvider
1. Listing the roles
Add in your a dict as following:
2. Create a dataProvider
Add a provider in your test class:
3. Create a unittest
Write unittests using the previous dataProvider
Custom printer
If you want use a custom printer add printerClass
attribute with Chaplean\Bundle\UnitBundle\TextUI\ResultPrinter
value in phpunit.xml
All versions of unit-bundle with dependencies
doctrine/doctrine-bundle Version ^1.6
doctrine/doctrine-fixtures-bundle Version ^3.0
doctrine/orm Version ^2.5
liip/functional-test-bundle Version ^1.9
mockery/mockery Version ^1.0
nelmio/alice Version ^2.0
phpunit/phpunit Version ^7.0
symfony/config Version ^3.0 || ^4.0
symfony/dependency-injection Version ^3.0|^4.0
symfony/yaml Version ^3.0 || ^4.0
symfony/browser-kit Version ^3.0 || ^4.0
symfony/dom-crawler Version ^3.0 || ^4.0