PHPackages                             ingenerator/koharness - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ingenerator/koharness

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ingenerator/koharness
=====================

Create test harnesses for Kohana modules by building a clean application container

v0.1.0(12y ago)22042BSD-3-ClausePHPPHP &gt;=5.3.3

Since Aug 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/ingenerator/koharness)[ Packagist](https://packagist.org/packages/ingenerator/koharness)[ Docs](https://github.com/ingenerator/koharness)[ RSS](/packages/ingenerator-koharness/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (3)Versions (2)Used By (2)

koharness - create clean Kohana containers for testing your modules
===================================================================

[](#koharness---create-clean-kohana-containers-for-testing-your-modules)

koharness is a very simple package to help you provide a clean testing environment for your Kohana modules. Once enabled, it will generate a basic Kohana application containing your module and any dependencies, which you can then use as the basis for running tests with your favourite tools.

Unlike the standard Kohana test bootstrappers, koharness allows you to control module loading order, which may be vital for modules that are designed to extend other modules.

Adding it as a project dependency
---------------------------------

[](#adding-it-as-a-project-dependency)

The easiest way to add koharness to your project is with [composer](http://getcomposer.org). Create a composer.json in the root of your module's folder like so:

```
{
	"require-dev": {
		"ingenerator/koharness" : "*"
	}
}
```

Ensure your .gitignore file includes the following lines:

```
/vendor
/modules

```

Run `composer install --dev` in your module's root directory.

Configuring module dependencies
-------------------------------

[](#configuring-module-dependencies)

Your module will require at least the Kohana core and the Kohana unittest module to function - and it may require other modules too. We recommend tracking these dependencies in your composer.json too

- currently the core Kohana repository doesn't define composer packages so you should use the inGenerator forks:

```
{
	"require": {
		"kohana/core":     "dev-ingenerator-master",
		"kohana/unittest": "dev-ingenerator-master"
	},
	"repositories": [
		{"type": "vcs", "url": "https://github.com/ingenerator/kohana-core"},
		{"type": "vcs", "url": "https://github.com/ingenerator/kohana-unittest"}
	]
}
```

Alternatively, you could define custom packages in your module's composer.json that track the specific git revision in the main Kohana repositories.

Or, add a shell script to your project to clone the required repositories and checkouts to your local disk.

However you get your dependencies to your machine, you then need to configure koharness to include them in your Kohana installation's active module list. You do this with a koharness.php file in the repository root:

```
// {my-module-root}/koharness.php
return array(
	'modules' => array(
		'my-module' => __DIR__,
		'unittest' => __DIR__.'/modules/unittest' // Or any other way you want to specify the path to this module
	),

	// You can specify where to look for Kohana core - the default is {my-module-root}/vendor/kohana/core
	'syspath' => '/some/path/to/kohana/core',

	// You can specify where to create the harness application - the default is /tmp/koharness
	'temp_dir' => '/home/me/testing'
);
```

Building your harness
---------------------

[](#building-your-harness)

To build your harness, from your module root directory just run `vendor/bin/koharness` (presuming you have left your composer `bin-dir` property at default. This will:

- Wipe out your specified temp directory
- Create a standard generic Kohana directory structure in the temp directory
- Link the kohana core directory to {temp}/system
- Link each module to {temp}/modules/{name}
- Link your module's vendor path to {temp}/vendor
- Customise the generic application bootstrap with your module list and output it to {temp}/application/bootstrap.php

Running tests
-------------

[](#running-tests)

Once you have built your harness, you can run tests using whatever tool you prefer. For example, you could use phpunit:

```
cd /tmp/koharness
vendor/bin/phpunit --bootstrap=modules/unittest/bootstrap.php modules/unittest/tests.php
```

License
-------

[](#license)

Copyright (c) 2013, inGenerator Ltd All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of inGenerator Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4716d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f6ebcc608a86cec9a3ce7a4932994e2b89fabbfcdde69aff43e8139f34e07a5e?d=identicon)[acoulton](/maintainers/acoulton)

---

Top Contributors

[![acoulton](https://avatars.githubusercontent.com/u/416566?v=4)](https://github.com/acoulton "acoulton (13 commits)")

---

Tags

kohanatests

### Embed Badge

![Health badge](/badges/ingenerator-koharness/health.svg)

```
[![Health](https://phpackages.com/badges/ingenerator-koharness/health.svg)](https://phpackages.com/packages/ingenerator-koharness)
```

###  Alternatives

[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k37.2M3.2k](/packages/phpspec-phpspec)[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

601170.6M2.2k](/packages/dealerdirect-phpcodesniffer-composer-installer)[dama/doctrine-test-bundle

Symfony bundle to isolate doctrine database tests and improve test performance

1.2k39.5M199](/packages/dama-doctrine-test-bundle)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[thedoctor0/laravel-factory-generator

Automatically generate Laravel factories for your models.

2131.0M1](/packages/thedoctor0-laravel-factory-generator)[typo3/testing-framework

The TYPO3 testing framework provides base classes for unit and functional testing.

675.3M1.1k](/packages/typo3-testing-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
