PHPUnit integration for Kohana
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
classes Merge pull request #57 from kohana/3.3/develop-before-force-push-andrew Oct 2, 2015
config Merge pull request #26 from jessedc/3.3/develop Oct 1, 2012
guide/unittest
.gitignore Configure standalone travis build Sep 17, 2014
.gitmodules Vendoring PHPUnit 3.5. Refs #4381. Jan 3, 2012
.travis.yml Resolve composer downloading and caching issues on Travis Mar 23, 2016
README.markdown Update README and add travis build badges Oct 10, 2014
bootstrap.php Only load unittest module in bootstrap if not already loaded Oct 10, 2014
bootstrap_all_modules.php Don't add . and .. directories to the dynamic module list Aug 12, 2014
composer.json
example.phpunit.xml The two dashes in the example comment was causing problems with the x… Apr 5, 2010
koharness.php Configure standalone travis build Sep 17, 2014
tests.php Initial pass for PSR-0 autoloading support. Refs #4001 Feb 11, 2012

README.markdown

Kohana-PHPUnit integration

ver Stable Develop
3.3.x Build Status - 3.3/master Build Status - 3.3/develop
3.4.x Build Status - 3.4/master Build Status - 3.4/develop

This module integrates PHPUnit with Kohana and is used to run all the core Kohana tests. In most cases you will not need to use this module for testing your own projects. If there are particular helpers provided here that you rely on, that may be a sign that your own code is too closely coupled to the behaviour of the Kohana core classes.

If you look through any of the tests provided in this module you'll probably notice all theHorribleCamelCase. I've chosen to do this because it's part of the PHPUnit coding conventions and is required for certain features such as auto documentation.

Requirements and installation

Dependencies are listed in the composer.json - run composer install to install the module and all external requirements. Note that more usually you will add this module to your own module's composer.json:

{
  "require-dev": {
    "kohana/unittest": "3.3.*@dev"
  }
}

Usage

$ phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php

Alternatively you can use a phpunit.xml to have a more fine grained control over which tests are included and which files are whitelisted.

Make sure you only whitelist the highest files in the cascading filesystem, else you could end up with a lot of "class cannot be redefined" errors.

If you use the tests.php testsuite loader then it will only whitelist the highest files. see config/unittest.php for details on configuring the tests.php whitelist.