Download the PHP package blainesch/li3_unit without Composer
On this page you can find all versions of the php package blainesch/li3_unit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blainesch/li3_unit
More information about blainesch/li3_unit
Files in blainesch/li3_unit
Package li3_unit
Short Description Adds extra assert methods and simple ways to create models, controllers, and helpers.
License The BSD License
Homepage https://github.com/BlaineSch/li3_unit
Informations about the package li3_unit
li3_unit - Lithium PHP
Adds extra assert methods and simple ways to create models, controllers, and helpers.
Installation
Composer
{
"require": {
...
"composer/installers": "*",
"blainesch/li3_unit": ">=1.0.0"
...
}
}
php composer.phar install
Submodule
git submodule add git://github.com/blainesch/li3_unit.git libraries/li3_unit
Clone Directly
git clone git://github.com/blainesch/li3_unit.git libraries/li3_unit
Usage
Load the plugin
Add the plugin to be loaded with Lithium's autoload magic
In app/config/bootstrap/libraries.php
add:
Extra Assertions
Currently tests extend \lithium\test\Unit instead, extend \li3_unit\test\Unit which extends the default lithium Unit this gives you access to new assertion methods. To read up on all the different assertions visit the assertions.md file.
Calling a controller
Instead of extending our built-in Unit class, extend ControllerUnit. You still have access to all of the extra assertion methods and Lithium's built in features, but also have access to a new 'call' method.
Calling a helper
Similar to before we will change ControllerUnit to HelperUnit and have access to a new method 'create' which will help create new helpers for us to test against.
Calling a model
You're probably better off using a library such as li3_fixtures, but for those of us just wanting a one-in-all package this library can help test non-relational model instance methods.