{"id":13519352,"url":"https://github.com/kahlan/kahlan","last_synced_at":"2026-10-19T15:19:38.054Z","repository":{"id":10128267,"uuid":"12199480","full_name":"kahlan/kahlan","owner":"kahlan","description":":heavy_check_mark: PHP Test Framework for Freedom, Truth, and Justice","archived":false,"fork":false,"pushed_at":"2026-10-09T18:49:40.000Z","size":3709,"stargazers_count":1146,"open_issues_count":9,"forks_count":69,"subscribers_count":26,"default_branch":"dev","last_synced_at":"2026-10-09T21:21:37.983Z","etag":null,"topics":["bdd","coverage","monkey-patching","php","spec","tdd","test"],"latest_commit_sha":null,"homepage":"https://kahlan.github.io/docs/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kahlan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-08-18T18:12:58.000Z","updated_at":"2026-10-09T14:02:42.000Z","dependencies_parsed_at":"2023-12-05T09:27:28.619Z","dependency_job_id":"f352cbd6-cc68-40ad-bc12-1325fc283ba9","html_url":"https://github.com/kahlan/kahlan","commit_stats":{"total_commits":967,"total_committers":37,"mean_commits":"26.135135135135137","dds":"0.19855222337125134","last_synced_commit":"076da1c9747da903a510ec80e44f15536d23bacb"},"previous_names":["crysalead/kahlan"],"tags_count":133,"template":false,"template_full_name":null,"purl":"pkg:github/kahlan/kahlan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahlan%2Fkahlan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahlan%2Fkahlan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahlan%2Fkahlan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahlan%2Fkahlan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kahlan","download_url":"https://codeload.github.com/kahlan/kahlan/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kahlan%2Fkahlan/sbom","scorecard":{"id":547424,"data":{"date":"2025-08-11","repo":{"name":"github.com/kahlan/kahlan","commit":"2cb353e5faa505328bef00abcc1eb5f82790ff20"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 7/30 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'dev'","Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T09:53:37.660Z","repository_id":10128267,"created_at":"2025-08-20T09:53:37.660Z","updated_at":"2025-08-20T09:53:37.660Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38358912,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","coverage","monkey-patching","php","spec","tdd","test"],"created_at":"2024-08-01T05:01:57.729Z","updated_at":"2026-10-19T15:19:36.860Z","avatar_url":"https://github.com/kahlan.png","language":"PHP","funding_links":[],"categories":["PHP","Table of Contents","目录","Tools","Testing and Quality","测试 Testing"],"sub_categories":["Testing","测试 Testing","PHP","Globalization"],"readme":"![Kahlan](docs/assets/logo.png \"Kahlan\")\n\u003chr/\u003e\n\n![Build Status](https://github.com/kahlan/kahlan/workflows/Build/badge.svg) [![License](https://poser.pugx.org/kahlan/kahlan/license.svg)](https://packagist.org/packages/kahlan/kahlan)\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/kahlan/kahlan.svg)](https://packagist.org/packages/kahlan/kahlan)\n[![Total Downloads](https://img.shields.io/packagist/dt/kahlan/kahlan.svg)](https://packagist.org/packages/kahlan/kahlan)\n[![Code Coverage](https://codecov.io/gh/kahlan/kahlan/branch/dev/graph/badge.svg)](https://app.codecov.io/gh/kahlan/kahlan/)\n\nKahlan is a full-featured Unit \u0026 BDD test framework a la RSpec/JSpec which uses a `describe-it` syntax and moves testing in PHP one step forward.\n\n**Kahlan lets you stub or monkey patch your code directly like in Ruby or JavaScript without any required PECL-extensions.**\n\n## Videos\n\n* \u003ca href=\"http://vimeo.com/116949820\" target=\"_blank\"\u003eWarren Seymour presentation at Unified Diff (2015)\u003c/a\u003e\n* \u003ca href=\"https://www.grafikart.fr/tutoriels/php/tdd-kahlan-805\" target=\"_blank\"\u003eGrafikart presentation in French (2016, Kahlan 2.X)\u003c/a\u003e\n\n## IRC\n\n**chat.freenode.net** (server)\n**#kahlan** (channel)\n\n## Documentation\n\nSee the [full documentation here](https://kahlan.github.io/docs)\n\n## Requirements\n\n * PHP 7.4+\n * Composer\n * [phpdbg](http://php.net/manual/en/debugger-about.php) or [Xdebug](http://xdebug.org/) (only required for code coverage analysis)\n\n## Main Features\n\n* RSpec/JSpec syntax\n* Code Coverage metrics ([xdebug](http://xdebug.org) or [phpdbg](http://phpdbg.com/docs) required)\n* Handy stubbing system ([mockery](https://github.com/padraic/mockery) or [prophecy](https://github.com/phpspec/prophecy) are no longer needed)\n* Set stubs on your class methods directly (i.e allows dynamic mocking)\n* Ability to Monkey Patch your code (i.e. allows replacement of core functions/classes on the fly)\n* Check called methods on your classes/instances\n* Built-in Reporters (Terminal or HTML reporting through [istanbul](https://gotwarlost.github.io/istanbul/) or [lcov](http://ltp.sourceforge.net/coverage/lcov.php))\n* Built-in Exporters (Coveralls, Code Climate, Scrutinizer, Clover)\n* Extensible, customizable workflow\n\n## Syntax\n\n```php\n\u003c?php\n\ndescribe(\"Example\", function() {\n\n    it(\"makes an expectation\", function() {\n\n         expect(true)-\u003etoBe(true);\n\n    });\n\n    it(\"expects methods to be called\", function() {\n\n        $user = new User();\n        expect($user)-\u003etoReceive('save')-\u003ewith(['validates' =\u003e false]);\n        $user-\u003esave(['validates' =\u003e false]);\n\n    });\n\n    it(\"stubs a function\", function() {\n\n        allow('time')-\u003etoBeCalled()-\u003eandReturn(123);\n        $user = new User();\n        expect($user-\u003esave())-\u003etoBe(true)\n        expect($user-\u003ecreated)-\u003etoBe(123);\n\n    });\n\n    it(\"stubs a class\", function() {\n\n        allow('PDO')-\u003etoReceive('prepare', 'fetchAll')-\u003eandReturn([['name' =\u003e 'bob']]);\n        $user = new User();\n        expect($user-\u003eall())-\u003etoBe([['name' =\u003e 'bob']]);\n\n    });\n\n});\n\n```\n\n## Screenshots\n\n### Example of default reporting:\n![dot_reporter](docs/assets/dot_reporter.png)\n\n### Example of verbose reporting:\n![verbose_reporter](docs/assets/verbose_reporter.png)\n\n### Example of code coverage on a specific scope:\n![code_coverage](docs/assets/code_coverage.png)\n\n## Installation\n\n### via Composer\n\n```bash\n$ composer require --dev kahlan/kahlan\n```\n\nNote:\nKahlan uses the [Semantic Versioning](http://semver.org/) and maintains a `CHANGELOG` to help you easily understand what's happening.\n\n### via Git clone\n\n```\ngit clone git://github.com/kahlan/kahlan.git\ncd kahlan\ncomposer install\nbin/kahlan              # to run specs or,\nbin/kahlan --coverage=4 # to run specs with coverage info for namespaces, classes \u0026 methods (require xdebug)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahlan%2Fkahlan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkahlan%2Fkahlan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkahlan%2Fkahlan/lists"}