Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Behat Api Extension Laravel Package

imbo/behat-api-extension

Behat 3 extension for testing JSON-based APIs. Simplifies making HTTP requests, asserting responses, and validating JSON payloads in your scenarios. Inspired by behat/web-api-extension and built for API testing workflows like Imbo.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API-First Development Strategy: Accelerates testing of JSON-based APIs in alignment with modern microservices and headless architectures.
  • BDD (Behavior-Driven Development) Roadmap: Enables non-technical stakeholders (e.g., product managers, QA) to define API behavior in plain language via Gherkin syntax, improving collaboration.
  • Build vs. Buy: Avoids reinventing wheel for API testing in Behat; leverages a battle-tested, MIT-licensed package with active maintenance (last release: 2026).
  • Use Cases:
    • Validating REST/GraphQL API responses against business rules (e.g., "As a user, I should receive a 200 status when submitting a valid order").
    • Automated regression testing for API endpoints during CI/CD pipelines.
    • Contract testing for microservices (e.g., verifying API schemas between services).
    • Onboarding new engineers by providing clear, executable API specifications.

When to Consider This Package

  • Adopt if:

    • Your team uses Behat 3+ for BDD and needs to test JSON-based APIs (REST, GraphQL, etc.).
    • You prioritize collaboration between devs, QA, and product teams via Gherkin scenarios.
    • Your API relies on complex request/response validation (e.g., nested JSON, arrays, form data, file uploads).
    • You’re using PHP 8.1+ (or can upgrade; see upgrade docs).
    • You need support for all HTTP methods (GET, POST, PUT, PATCH, DELETE) and form/multipart data.
  • Look elsewhere if:

    • Your API is not JSON-based (e.g., XML, protobufs) or uses non-standard protocols.
    • You require advanced performance testing (use tools like k6 or Gatling instead).
    • Your team prefers code-based testing frameworks (e.g., PHPUnit, Pest) over BDD.
    • You need GUI-based API testing (consider Postman/Newman or Karate).
    • Your PHP version is <8.1 (package drops support for older versions; see release notes).

How to Pitch It (Stakeholders)

For Executives:

"This package lets us test our APIs faster and with fewer bugs by letting product teams define API behavior in plain English—just like user stories. For example, instead of writing complex code to validate an API response, a PM can write:

Given I have a valid user token
When I send a POST request to "/orders" with:
{
  "product_id": 123,
  "quantity": 2
}

Then the response should have status code 201 And the response should contain "order_id" in the root.

*This reduces dev/QA bottlenecks, improves API reliability, and aligns testing with business requirements. It’s also MIT-licensed and actively maintained, so no vendor lock-in."*

### **For Engineering**:
*"This is a lightweight, well-documented Behat extension that bridges the gap between BDD and API testing. Key benefits:*
- **Seamless integration**: Works with existing Behat suites; no need to rewrite tests.
- **Rich assertions**: Supports JSONPath-like queries, status code checks, and complex data validation (e.g., nested arrays, form data).
- **HTTP flexibility**: Handles all methods (PATCH, DELETE, etc.) and multipart uploads—critical for modern APIs.
- **Performance**: Minimal overhead; runs in CI/CD pipelines like any Behat test.
*Downside: Requires PHP 8.1+ (but worth the upgrade for long-term maintainability). Docs are [here](https://behat-api-extension.readthedocs.io/).*
*Alternatives like `behat/web-api-extension` are outdated; this is the active fork."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity