Download the PHP package peridot-php/peridot-httpkernel-plugin without Composer
On this page you can find all versions of the php package peridot-php/peridot-httpkernel-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download peridot-php/peridot-httpkernel-plugin
More information about peridot-php/peridot-httpkernel-plugin
Files in peridot-php/peridot-httpkernel-plugin
Package peridot-httpkernel-plugin
Short Description A Peridot plugin to simplify testing HttpKernel applications
License MIT
Informations about the package peridot-httpkernel-plugin
Peridot HttpKernel Plugin
Easily test HttpKernel applications with Peridot.
Some HttpKernel based frameworks:
- Silex
- [Laravel] (http://laravel.com/)
- [Symfony2] (http://symfony.com/what-is-symfony)
Usage
We recommend installing this plugin to your project via composer:
You can register the plugin via your peridot.php file.
By registering the plugin, your Peridot tests will now have a $client
property available:
Voilà!
Don't want a client in all of your tests? No problem.
Using on a test by test basis
Like any other peridot scope, you can mix the HttpKernelScope
provided by this plugin
on a test by test, or suite by suite basis.
Configuring the client property name
If $this->client
is a little too generic for your tastes, both the scope and plugin take an optional last argument that allows you to
you set this.
Your tests now become:
Example specs
This repo comes with a sample Silex application that is tested with this plugin.
To test examples that are using the plugin, run the following:
To test examples that are manually adding the scope in, run this: