rmb32 / scenario-runner-cli
Scenario Runner CLI — the unit-test scaffolding wizard as a standalone CLI transport package for rmb32/scenario-runner
Requires
- php: ^8.5
- rmb32/barn-paths: ^0.1@dev
- rmb32/barnspec: ^0.1@dev
- rmb32/filesystem: ^1.0@dev
- rmb32/typed-input: ^2.0@dev
- symfony/console: ^8.0
Requires (Dev)
- deptrac/deptrac: ^4.7
- infection/infection: ^0.35.4
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^12.0
- rmb32/barntree: ^0.1@dev
- rmb32/typed-json: ^1.0@dev
- squizlabs/php_codesniffer: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Early, version 0.x. Not ready for real projects yet; the minor version is the breaking one.
Part of Barn.
The scenario-runner command: an interactive wizard that scaffolds an empty
PHPUnit test for a Work ticket — a unit-level
check that sits underneath your acceptance-level Scenarios. Built on
Scenario Runner.
Requirements
- PHP 8.5+
- A captured Story with a Work ticket (see below)
Installation
composer require --dev rmb32/scenario-runner-cli
Usage
In a barn with a captured Scenario, create a ticket with the Barnspec CLI, then scaffold a test for it:
composer require --dev rmb32/barnspec-cli
vendor/bin/barnspec work:create commerce basket-quantity-updates caps-at-the-stock-level --title="Cap quantity" --reference=SHOP-42
vendor/bin/scenario-runner commerce basket-quantity-updates caps-at-the-stock-level --output-dir=tests/Unit
It prompts for the ticket, the target class and method (both checked to exist),
a plain-English description, and the test class's namespace. The result is one
#[Test] method whose body is markTestIncomplete('TODO: ...') — the test
shows as incomplete, not passing, until you write it.
It reads the stories of the barn it is run in: the nearest folder at or above the
current one that holds a .barn/ folder, and it names that barn's root first. With
no barn it stops and writes nothing; barnspec init makes one. --output-dir is
relative to the folder you run it from.
To run acceptance Scenarios instead, use Scenario Bridge.
Related packages
- Scenario Runner — the execution engine.
- Barnspec CLI — provides
workand the captured stories. - Scenario Bridge — run captured Scenarios.
License
Proprietary. See LICENSE. Copyright (c) Roger Barnfather.