# kahlan/kahlan

:heavy_check_mark: PHP Test Framework for Freedom, Truth, and Justice

Repository: https://github.com/kahlan/kahlan
Canonical: https://ross.abutalabs.com/products/kahlan
Homepage: https://kahlan.github.io/docs/
Language: PHP
License: MIT
License Family: permissive
Topics: php, bdd, test, tdd, spec, monkey-patching, coverage
Last push: 2026-07-21T08:32:09+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 82, longevity 100
- inputs: {"age_days": 4763, "days_push": 43, "days_rel": 43, "gap_med": 68, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1148, forks 70 (observed 2026-08-28T04:03:46.148158+00:00)

## What it is
Kahlan is a full-featured Unit and BDD test framework for PHP using a describe-it syntax similar to RSpec/JSpec. It includes built-in stubbing, monkey patching, and code coverage reporting without requiring PECL extensions.

## Use cases
- write BDD-style tests in PHP with describe-it syntax
- stub and mock class methods without mockery or prophecy
- monkey patch core PHP functions and classes in tests
- generate code coverage reports with xdebug or phpdbg
- export test coverage to Coveralls, Code Climate, or Clover
- verify that methods are called with expected arguments

## When to choose
- you prefer RSpec/JSpec-style BDD syntax over PHPUnit
- you need dynamic mocking or monkey patching without PECL extensions
- you want an all-in-one test framework with built-in stubbing and coverage

## When to avoid
- your team and tooling are standardized on PHPUnit
- you need a framework with a larger ecosystem and more recent community activity
- you cannot use xdebug or phpdbg and require code coverage

## Facets
- artifact type: framework
- maturity: active
- function: testing, e2e-testing, mocking, benchmarking
- domain: testing, developer-tools, web-development
- platform: php, cli, cross-platform
- tags: bdd, tdd, monkey-patching, code-coverage, stubbing, rspec-style

## Member repositories
- kahlan/kahlan (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:46.148158+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:33:50.795303+00:00, confidence not recorded.
  - readme: https://github.com/kahlan/kahlan (fetched 2026-08-28T04:03:46.148158+00:00, sha 1c8c3a230855)
  - homepage: https://kahlan.github.io/docs/ (fetched 2026-08-29T12:38:59.843887+00:00, sha 3b598c8eeef8)
- Data as of 2026-08-30T08:39:29.467469+00:00.
