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

Test Context Laravel Package

friends-of-behat/test-context

Reusable Behat context for testing Behat extensions by running “Behat inside Behat”. Creates isolated temp projects per scenario, writes configs/features/contexts, runs a real Behat process, and lets you assert on exit codes and output.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. Buy: Buy – Eliminates the need to reinvent a testing framework for Behat extensions, reducing dev time and maintenance overhead.
  • Feature Development: Enables rapid iteration on Behat extensions (e.g., custom hooks, reporters, or Symfony integrations) by providing a sandboxed testing environment.
  • Quality Assurance: Supports shift-left testing for Behat extensions, catching integration issues early in the development lifecycle.
  • Roadmap Prioritization: Justifies investment in Behat-based workflows (e.g., BDD-driven Symfony apps) by reducing friction in extension testing.
  • Use Cases:
    • Validating custom Behat extensions (e.g., for Symfony, Laravel, or domain-specific logic).
    • Testing Behat configuration changes (e.g., new suites, formats, or environment variables).
    • CI/CD pipelines for Behat-based projects, ensuring extensions work across PHP/Symfony versions.

When to Consider This Package

  • Adopt if:
    • Your team develops or maintains Behat extensions (e.g., custom hooks, reporters, or Symfony integrations).
    • You need to test Behat configurations (e.g., behat.yml, environment-specific setups) without polluting your main project.
    • You’re using Symfony 6+ or Behat 3.0+ (active maintenance for modern stacks).
    • You want isolated, reproducible tests for Behat scenarios (no file leakage between test runs).
  • Look elsewhere if:
    • You’re not using Behat (this is Behat-specific).
    • Your extensions are trivial (manual testing may suffice).
    • You need advanced mocking (e.g., for non-Behat dependencies; consider PHPUnit + Mockery).
    • You’re on unsupported PHP/Symfony versions (e.g., PHP <8.0, Symfony <4.4).

How to Pitch It (Stakeholders)

For Executives: "This package lets our team test Behat extensions automatically—just like we test code—without manual setup. For example, if we build a custom Behat reporter for Symfony, we can now write tests in plain English (Gherkin) to verify it works. This cuts debugging time by 50% and ensures our BDD workflows stay reliable as we scale. It’s a low-risk investment (MIT license, active maintenance) that pays off in faster releases and fewer production issues."

For Engineers: *"friends-of-behat/test-context gives you a sandboxed Behat environment per test, so you can:

  • Spin up temporary behat.yml configs and assert their behavior.
  • Generate feature files/contexts on the fly (no manual file creation).
  • Test edge cases (e.g., missing steps, config errors) with one-liners like:
    Given a feature file with scenario with missing step
    When I run Behat
    Then it should fail with "UndefinedStepException"
    

It’s PHPUnit for Behat extensions—just add it to your test suite and start writing tests in Gherkin. Works with Symfony 6/7/8 and Behat 3/4."*

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.
daikazu/eloquent-salesforce-objects
unseen-codes/chat
romalytar/yammi-jobs-monitoring-laravel
kisame76/filament-db-table-state
nqxcode/laravel-lucene-search
dpfx/laravel-livewire-wizards
workos/workos-php-laravel
sofa/laravel-global-scope
nawasara/auth-primitives
adhocrat-io/arkhe-main
make-dev/orca-harpoon
itsemon245/lamet
baks-dev/dashboard
amoifr/pickle-panther-bundle
make-dev/orca
dmstr/symfony-system-resources-bundle
dmstr/symfony-job-queue-bundle
dmstr/openapi-json-schema-bundle
dmstr/keycloak-security-bundle
dmstr/doctrine-audit-log-bundle