PHPackages                             crysalead/kahlan - 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. crysalead/kahlan

Abandoned → [kahlan/kahlan](/?search=kahlan%2Fkahlan)Library[Testing &amp; Quality](/categories/testing)

crysalead/kahlan
================

The PHP Test Framework for Freedom, Truth and Justice.

5.2.0(4y ago)1.1k60.7k70[7 issues](https://github.com/crysalead/kahlan/issues)20MITPHPPHP &gt;=7.1CI passing

Since Jan 24Pushed 3mo ago27 watchersCompare

[ Source](https://github.com/crysalead/kahlan)[ Packagist](https://packagist.org/packages/crysalead/kahlan)[ RSS](/packages/crysalead-kahlan/feed)WikiDiscussions dev Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (126)Used By (20)

[![Kahlan](docs/assets/logo.png "Kahlan")](docs/assets/logo.png)

---

[![Build Status](https://github.com/kahlan/kahlan/workflows/Build/badge.svg)](https://github.com/kahlan/kahlan/workflows/Build/badge.svg) [![License](https://camo.githubusercontent.com/1af6855fe9804cffebfc500895a466b4fbffb2a11a35b45586466a59bc48b6b3/68747470733a2f2f706f7365722e707567782e6f72672f6b61686c616e2f6b61686c616e2f6c6963656e73652e737667)](https://packagist.org/packages/kahlan/kahlan)

[![Latest Stable Version](https://camo.githubusercontent.com/f67efe52786783c2c1ac95dacbc1c0dc587cf9a0694d5f7312a02ef0dd2bb6e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61686c616e2f6b61686c616e2e737667)](https://packagist.org/packages/kahlan/kahlan)[![Total Downloads](https://camo.githubusercontent.com/ef2c4674ee31c8b896cbdce2b6c2ea00fac29b5c9b5a8f2924a571d93955655c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61686c616e2f6b61686c616e2e737667)](https://packagist.org/packages/kahlan/kahlan)[![Code Coverage](https://camo.githubusercontent.com/b7623b3984cc77a4bb45667cc5c555764f66814911d1af08286c648d8cc4cbe7/68747470733a2f2f636f6465636f762e696f2f67682f6b61686c616e2f6b61686c616e2f6272616e63682f6465762f67726170682f62616467652e737667)](https://app.codecov.io/gh/kahlan/kahlan/)

Kahlan is a full-featured Unit &amp; BDD test framework a la RSpec/JSpec which uses a `describe-it` syntax and moves testing in PHP one step forward.

**Kahlan lets you stub or monkey patch your code directly like in Ruby or JavaScript without any required PECL-extensions.**

Videos
------

[](#videos)

- [Warren Seymour presentation at Unified Diff (2015)](http://vimeo.com/116949820)
- [Grafikart presentation in French (2016, Kahlan 2.X)](https://www.grafikart.fr/tutoriels/php/tdd-kahlan-805)

IRC
---

[](#irc)

**chat.freenode.net** (server) **\#kahlan** (channel)

Documentation
-------------

[](#documentation)

See the [full documentation here](https://kahlan.github.io/docs)

Requirements
------------

[](#requirements)

- PHP 7.4+
- Composer
- [phpdbg](http://php.net/manual/en/debugger-about.php) or [Xdebug](http://xdebug.org/) (only required for code coverage analysis)

Main Features
-------------

[](#main-features)

- RSpec/JSpec syntax
- Code Coverage metrics ([xdebug](http://xdebug.org) or [phpdbg](http://phpdbg.com/docs) required)
- Handy stubbing system ([mockery](https://github.com/padraic/mockery) or [prophecy](https://github.com/phpspec/prophecy) are no longer needed)
- Set stubs on your class methods directly (i.e allows dynamic mocking)
- Ability to Monkey Patch your code (i.e. allows replacement of core functions/classes on the fly)
- Check called methods on your classes/instances
- Built-in Reporters (Terminal or HTML reporting through [istanbul](https://gotwarlost.github.io/istanbul/) or [lcov](http://ltp.sourceforge.net/coverage/lcov.php))
- Built-in Exporters (Coveralls, Code Climate, Scrutinizer, Clover)
- Extensible, customizable workflow

Syntax
------

[](#syntax)

```
