Download the PHP package spiffy/spiffy-test without Composer
On this page you can find all versions of the php package spiffy/spiffy-test. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spiffy/spiffy-test
More information about spiffy/spiffy-test
Files in spiffy/spiffy-test
Package spiffy-test
Short Description PHPUnit bootstrapping module for ZF2
License
Homepage http://www.github.com/spiffyjr/spiffy-test.git
Informations about the package spiffy-test
SpiffyTest
SpiffyTest is a module for bootstrapping PHPUnit and supplying you with a basic service manager instance.
Installation
Installation of SpiffyTest uses composer. For composer documentation, please refer to getcomposer.org.
- Copy
spiffy-test/Bootstrap.php.dist
to yourtests/Bootstrap.php
. - Copy
spiffy-test/config/test.application.config.php.dist
to yourconfig/test.application.config.php
and modify themodules
key to include any test dependent modules. - Copy
spiffy-test/config/test.module.config.php.dist
to yourconfig/test.module.config.php.dist
if you have test specific module overrides (i.e., removing memcache in favor of array cache).
Installation without composer is not officially supported and requires you to setup autoloading on your own.
Usage
Using SpiffyTest involves setting up your testing bootstrap, module config, and application config (optional).
- copy
bootstrap.php.dist
to yourtest
directory and rename tobootstrap.php
. Setupphpunit.xml
to use this as your bootstrap file. - copy
module.config.php.dist
to yourtest
directory and rename tomodule.config.php
. Be sure to leaveSpiffyTest
in your list of modules! - if you have a custom application.config.php requirement then copy
application.config.php.dist
to yourtest
directory and rename toapplication.config.php
.
Once everything is setup you can access the Module singleton by using \SpiffyTest\Module::getInstance()
. This class
has helper methods availabe such as getApplication()
, getServiceManager()
and getApplicationConfig()
for testing a mvc stack. You can
reset everything by using the reset()
method.
Controllers
SpiffyTest comes with \SpiffyTest\Controller\AbstractHttpControllerTestCase
which is a customized controller test case
that uses SpiffyTest's application. To use, simply have your tests extend the class.
All versions of spiffy-test with dependencies
zendframework/zend-loader Version ~2.2
zendframework/zend-modulemanager Version ~2.2
zendframework/zend-mvc Version ~2.2
zendframework/zend-view Version ~2.2