imbo/behat-api-extension
A Behat 3 extension that provides an easy way to test JSON-based APIs with readable Gherkin steps. Inspired by behat/web-api-extension and originally written to test the Imbo API, it simplifies HTTP request and response assertions in your test suite.
Context classes wrapping our HTTP client and JSON assertions — code we own forever. The buy is cheap and low-ceremony: MIT, Composer-installable, no vendor relationship. Because the package's scope is narrow and its community is small, this is a convenience buy, not a strategic one. Do not let it become load-bearing infrastructure..feature files double as onboarding material for new engineers and support.Adopt when:
behat.yml. Without an existing suite, adopting Behat plus this extension is a far larger commitment than the package size suggests.Look elsewhere when:
$this->postJson(), assertJsonStructure(), and Http::fake() cover much of the same ground in-process, faster, with no server bootstrapping and no new DSL. Choosing Behat here is a collaboration trade-off, not a technical upgrade.Sizing note: the dependency's surface area is genuinely small — a request-step vocabulary plus JSON assertions. Adoption cost is dominated by Behat setup, environment provisioning, and test-data management. Budget accordingly and gate the decision on a one-endpoint pilot before committing a suite.
For executives — one paragraph: "This lets product and QA write API acceptance tests in plain English rather than PHP, and run them against our real deployed API. A PM can specify 'POST /orders with a valid payload returns 201 and an order_id' as an executable scenario that fails the build when it breaks. The package itself is MIT-licensed, free, and small enough that we could replace it ourselves if it were ever abandoned — so there's no vendor and no lock-in. The real cost isn't the license; it's the discipline of maintaining a second, business-readable test suite alongside our unit tests, plus the Gherkin skills to write it. I recommend a two-week pilot on one endpoint before we commit, because the entire value depends on whether product and QA actually author these scenarios — if only engineers end up writing them, we should stay with PHPUnit and decline."
For engineering — the pragmatic version:
How can I help you explore Laravel packages today?