PHPackages                             joefallon/kisstest - 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. joefallon/kisstest

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

joefallon/kisstest
==================

KissTest is command-line free, fast, simple and beautiful unit test framework.

v5.0.0(7mo ago)144501MITPHPPHP &gt;=7.4

Since Jul 11Pushed 7mo ago2 watchersCompare

[ Source](https://github.com/joefallon/kisstest)[ Packagist](https://packagist.org/packages/joefallon/kisstest)[ Docs](https://github.com/joefallon/kisstest)[ RSS](/packages/joefallon-kisstest/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (36)Used By (1)

KissTest
========

[](#kisstest)

By [Joe Fallon](http://blog.joefallon.net/)

A Keep-It-Simple-Straightforward, fast, and beautiful xUnit style unit test library.

Here is an example of some passing tests:

[![KissTest Passing Tests](https://camo.githubusercontent.com/4340ab72b23f25c3ee461ad2c7d57d02f6ddfe67afb2faee09f240417f0fa64c/687474703a2f2f692e696d6775722e636f6d2f78504a4836796e2e706e67)](https://camo.githubusercontent.com/4340ab72b23f25c3ee461ad2c7d57d02f6ddfe67afb2faee09f240417f0fa64c/687474703a2f2f692e696d6775722e636f6d2f78504a4836796e2e706e67)

It provides several useful features and benefits not available in other unit testing frameworks:

- The display of the testing results is completely displayed right in the browser. The layout is beautiful and non-saturated colors were chosen giving a wonderful testing experience.
- Detailed metrics for all tests is displayed right in the browser window. Now you can immediately determine which tests are taking so much time.
- The results of all the tests are displayed in a table of contents format. If a test failed, it will be red. Click on it and go right to the results for the failing test. Then, click the handy "top" link and go right back to the table of contents. Better yet, fix the test, press F5 and see the test go green.
- No CLI access is needed. None.
- Technically, the CLI PHP executable is not the same one that is used to serve web pages. It's close, but not the same one. Since the CLI is not used in KissTest, the execution environment can be set up to be identical to the production environment. Having the production environment match the testing environment as close as practical is always a great practice.
- It's fast. Really fast. No code injection, dynamic class modification, or eval is used anywhere. The testing framework is light and nimble.
- Easy to understand. Do you have a new developer on your team that is a little green and inexperienced? No problem, this testing framework can be learned in 10-15 minutes.
- A full mocking and class stubbing solution is included as well.
- The mocking/stubbing functionality is simple and fast. Really fast.
- All test suite setup is performed via plain PHP. No annotations. No XML. No JSON. No \*.ini files. Just simple, sweet, and to-the-point PHP.

Here is an example containing some failing tests with some useful features annotated:

[![KissTest Passing Tests](https://camo.githubusercontent.com/3f4171c7a80a20bbb307fd0f1f63757ebffd357e0b1868b61a86b57fafa83a6a/687474703a2f2f692e696d6775722e636f6d2f3158336f3462422e706e67)](https://camo.githubusercontent.com/3f4171c7a80a20bbb307fd0f1f63757ebffd357e0b1868b61a86b57fafa83a6a/687474703a2f2f692e696d6775722e636f6d2f3158336f3462422e706e67)

Installation
------------

[](#installation)

The easiest way to install KissTest is with [Composer](https://getcomposer.org/). Create the following `composer.json` file and run the `php composer.phar install` command to install it.

```
{
    "require": {
        "joefallon/kisstest": "*"
    }
}
```

Configuration and Test Setup
----------------------------

[](#configuration-and-test-setup)

### Directory Structure

[](#directory-structure)

Since KissTest uses just PHP for configuration there are an infinite number of ways to configure and set up a test suite. The following method is simple and straight forward.

Here is an example directory structure structure:

```
ProjectDirectory
 |
 +-->src
 |    |
 |    +--> Folder1
 |    |     |
 |    |     +--> CodeFile1.php
 |    |
 |    +--> Folder2
 |          |
 |          +--> CodeFile2.php
 |
 +-->tests
       |
       +--> Folder1
       |     |
       |     +--> CodeFile1Tests.php            Folder2
       |     |
       |     +--> CodeFile2Tests.php            index.php
