← 返回命令列表

Linux command

kahlan 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run tests

kahlan

Run specific spec

kahlan --spec=[spec/MySpec.php]

Filter by pattern

kahlan --pattern="[*Spec.php]"

Generate coverage

kahlan --coverage=[4]

Output as reporter

kahlan --reporter=[dot|bar|verbose]

Run with config

kahlan --config=[kahlan-config.php]

说明

Kahlan is a BDD testing framework for PHP. It uses a describe-it syntax similar to Jasmine/RSpec. The tool supports mocking, stubbing, and code coverage. It focuses on behavior-driven development.

参数

--spec _PATH_
Specific spec file/directory.
--pattern _GLOB_
File pattern.
--coverage _LEVEL_
Coverage level (1-4).
--reporter _NAME_
Output reporter.
--config _FILE_
Configuration file.
--help
Display help information.

FAQ

What is the kahlan command used for?

Kahlan is a BDD testing framework for PHP. It uses a describe-it syntax similar to Jasmine/RSpec. The tool supports mocking, stubbing, and code coverage. It focuses on behavior-driven development.

How do I run a basic kahlan example?

Run `kahlan` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --spec _PATH_ do in kahlan?

Specific spec file/directory.