PHPackages                             okay/okay - 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. okay/okay

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

okay/okay
=========

Ultra Simple Specs/Tests for PHP all versions &gt;= 5.3

v1.0.6(3y ago)120MITPHP &gt;=5.3

Since Jun 7Compare

[ Source](https://github.com/keithy/okay-php)[ Packagist](https://packagist.org/packages/okay/okay)[ Docs](https://github.com/keithy/okay-php)[ RSS](/packages/okay-okay/feed)WikiDiscussions Synced 4d ago

READMEChangelog (6)DependenciesVersions (7)Used By (0)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)[![Tests Status](https://github.com/keithy/okay-php/actions/workflows/php.yml/badge.svg)](https://github.com/keithy/okay-php/actions)[![GitHub issues](https://camo.githubusercontent.com/9e22f282e930f78eb54d2ebce5ff91dfb9f79339c04c28d1732d40432dd004fd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6b65697468792f6f6b61792d7068702e737667)](https://github.com/keithy/okay-php/issues)[![Awesome](https://camo.githubusercontent.com/e3718252e9cb9d236e13f891808bc5861337368a897129bbdcb34f1c89ce1d77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f617765736f6d652533462d796573212d627269676874677265656e2e737667)](https://packagist.org/packages/okay/okay)[![Latest Version](https://camo.githubusercontent.com/ea01b2852b37d4e4e447472bb8a3fec3799add52868dfa4140783ddece374c93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b65697468792f6f6b61792d7068702e737667)](https://github.com/keithy/okay-php/releases)[![Minimum PHP Version](https://camo.githubusercontent.com/08fdc2d0095008d0ee4363d606b4b1ad83e4239d2c2bd46e5aaf1e3f8741ba92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6f6b61792f6f6b61792e7376673f6d61784167653d33363030)](https://packagist.org/packages/okay/okay)[![Tested on PHP 5.3 to 8.2](https://camo.githubusercontent.com/fca27459f24a9a694c7ff9777bd524d445e1e18d61a90043c0d085ab81bb889e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7465737465642532306f6e2d504850253230352e33253230253743253230352e34253230253743253230352e35253230253743253230352e36253230253743253230372e31253230253743253230372e34253230253743253230382e31253230253743253230382e322532302d627269676874677265656e2e7376673f6d61784167653d32343139323030)](https://github.com/keithy/okay-php/actions)

OKAY 1.0 - Keeping It Simple Specifications for PHP
===================================================

[](#okay-10----keeping-it-simple-specifications-for-php)

Totally the simplest BDD/TDD framework,... in the world!

Design based on the original SUnit by Kent Beck

A result of another Cunningham-Beck innovation:

Example Test/Spec/Okays
-----------------------

[](#example-testspecokays)

- Tests - TDD
- Specs - BDD vocabulary
- Okays - Our name for platform tests

```
namespace ok {

    EXPECT("assertions ini configuration");

    _("to be enabled");

    assert(1 == ini_get('zend.assertions'));
    assert(0 == ini_get('assert.exception'));

}

```

Documentation:
--------------

[](#documentation)

1. `_okay.php` is all of the code (&lt;320 lines), both a command line and web test-runner
2. Adding `_ok.php` to a directory of `*.inc` scripts/directories turns them into a spec/test suite. (edit it to have the correct path to invoke `_okay.php`)

    Each `_ok.php` can be modified to provide any one-time run\_setup code for specs defined in that directory.
3. BDD style "english" output.

    ```
    EXPECT("it to be good");

    ```
4. Uses PHP built in `assert`

    ```
    _("it's going to be good");
    assert( $it == "good" , "'$it' wasn't good" );

    ```
5. Use throughout your codebase, deployment optional

    Great for adding specs/tests to a file-based "legacy" PHP system. (adjust your deployment to ignore/delete `_*` files, and it's gone.)
6. Zero dependencies

    Does not need a functioning composer/autoload, will not clutter a cool, lean code-base. Great for testing smaller bits and pieces (see .travis.yml for the non-trivial self-test example)
7. Excellent basis for "Platform Tests", "healthz" style checks, and White Screen of Death debugging

    Platform-tests run to verify that the deployment platform, PHP runtime, and Databases and other bits and pieces are configured and working as expected.

    When faced with the PHP - W.S.O.D. and no clues, a platform test/spec suite can check for common miss-configuration scenarios and tell you what is working.
8. Compare Runs - see only the differences

    ```
    # generate expected output
    php _okay.php | tee  .out
    # change something
    php _okay.php | diff -U5 .out -

    ```
9. Go Continuous - genius!

    ```
    watch -n3  'php _okay.php | diff -U5 .out -'

    ```
10. Works great with github actions

```
jobs:
 build:
   runs-on: ubuntu-latest
   - name: Run okay test suite
     run: php _okay.php

```

11. Works great with travis.ci

```
language: php
php: [5.6,7.1]
script: php okay/_okay.php -I

```

Usage Composer
--------------

[](#usage-composer)

```
composer require --dev okay/okay

```

Usage Standalone
----------------

[](#usage-standalone)

1. Copy the `_okay.php` file to somewhere within your project, or to the root of your specs/tests/okay folder.
2. Copy the `_ok.php` file to the root of any other specs/tests folder within your project. (edit it to have the correct path to invoke `_okay.php`)

Web Runner
----------

[](#web-runner)

Copy `public/okay.php`to somewhere on your site, and copy `config/gateway_okay.inc`(edit it to have the correct path to invoke `_okay.php`)

Example Output
--------------

[](#example-output)

Nothing fancy

```
OKAY(VERSION 1.0.2):/home/travis/build/keithy/okay-php

Given okay spec file returns true or false
 1) Expect returning true to be a pass and to look like this

Given okay_specs function copy_all_matching can prepare fixtures
 2) Expect fixture directory to be empty
 3) Expect copy_all files from snapshot to populate fixture directory
 4) Expect delete files matching *.inc
      should leave a *.php file
 5) Expect delete files matching *.php
      should leave directory empty

Given okay_specs function lookup_and_include is looking for needle
 6) Expect to find needle in same directory
 7) Expect to find needle via parent directory

Given okay_specs function lookup_and_include is looking for non existent file
 8) Expect it to return false

Given okay_specs example failure assertion fail, spec returns true
 9) Expect assertion failure
      to look like this
FAILED(14): assert failed AS EXPECTED
10) Expect specification return value
      should be ignored

Given okay_specs example failure assertion fail; spec returns false
11) Expect assertion failure
      to look like this
FAILED(14): assert failed AS EXPECTED
12) Expect specification return value
      should be ignored
Ran 6 files (12 expectations) failed 2 assertions

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Every ~280 days

Recently: every ~344 days

Total

6

Last Release

1181d ago

Major Versions

v0.9.19 → v1.0.02019-07-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/bac2932b979255dfbadcd6029fca581e1613f832640fbd2ef6a171b7ed177e79?d=identicon)[keithy.p](/maintainers/keithy.p)

---

Tags

testingBDDTDDtestsspecsunit-testsplatform-testsplatform-specs

### Embed Badge

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

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

###  Alternatives

[mockery/mockery

Mockery is a simple yet flexible PHP mock object framework

10.7k526.2M26.7k](/packages/mockery-mockery)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k37.5M3.2k](/packages/phpspec-phpspec)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k42.5M40.2k](/packages/orchestra-testbench)[orchestra/testbench-core

Testing Helper for Laravel Development

27248.1M380](/packages/orchestra-testbench-core)[php-mock/php-mock

PHP-Mock can mock built-in PHP functions (e.g. time()). PHP-Mock relies on PHP's namespace fallback policy. No further extension is needed.

37419.9M124](/packages/php-mock-php-mock)[kahlan/kahlan

The PHP Test Framework for Freedom, Truth and Justice.

1.1k1.2M257](/packages/kahlan-kahlan)

PHPackages © 2026

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