- What is macpaw/behat-doctrine-fixtures used for?
- It is a Behat extension/context that loads Doctrine ORM data fixtures into a database between Behat scenarios. It helps seed test data and purge it so acceptance scenarios remain isolated. It is specifically built around Behat and Doctrine ORM, not Laravel's default Eloquent testing stack.
- Does macpaw/behat-doctrine-fixtures work with Laravel?
- Only in the narrow case where a Laravel application already uses laravel-doctrine/orm and Behat. The package ships no Laravel or Eloquent surface, so it does not integrate with Laravel's default persistence or test idioms. For typical Laravel apps, PHPUnit/Pest with factories and RefreshDatabase is the practical choice.
- How do I install macpaw/behat-doctrine-fixtures?
- Install it with Composer using macpaw/behat-doctrine-fixtures, then register the provided context in behat.yml. You must already have Behat and Doctrine ORM configured, including an EntityManager and fixture paths. Because release tagging has been ambiguous, pin an exact version rather than relying on a caret range.
- Which Doctrine ORM versions does v2.2.0 support?
- Version 2.2.0 upgrades doctrine/orm to 3.x according to PR #26. The release notes do not state whether ORM 2.x remains supported, so the exact Composer constraint must be checked. If the constraint tightened to ^3.0, consumers on ORM 2.x face an unresolvable dependency or changed runtime semantics.
- Is v2.2.0 a breaking change from Doctrine ORM 2.x?
- It may be. A pull request titled Release 3.0 shipped as tag v2.2.0, and the ORM 3.x upgrade does not explicitly promise ORM 2.x retention. That means a minor version bump may silently move consumers across an ORM major version. Pin the exact version and test against ORM 3 and DBAL 4 behavior before updating.
- What PHP and Behat versions are supported?
- Support is not fully documented. Doctrine ORM 3.x implies a PHP 8.1+ floor, while Behat 3.x compatibility is assumed but not clearly stated in the release notes. No published CI matrix is mentioned, so verify composer constraints and run a smoke test in your own environment.
- Can I use this package with Eloquent models?
- No, it is designed for Doctrine ORM fixtures, not Eloquent models. Mixing an Eloquent application with Doctrine fixtures introduces two mapping layers and risks schema drift. If your app is Eloquent-based, use Laravel factories and seeders with PHPUnit or Pest instead.
- How does fixture loading and purging work between Behat scenarios?
- The context loads Doctrine fixtures and purges test data to keep Behat scenarios isolated. However, the exact semantics are a black box: it is undocumented whether it truncates tables, wraps scenarios in transactions, or does both, and ordering guarantees are unclear. Doctrine ORM 3 identity-map clearing, proxy generation, and lazy-loading changes can also compound stale EntityManager issues, so test isolation carefully.
- Is macpaw/behat-doctrine-fixtures actively maintained?
- It is a single-organization package with about 7 stars and 0 dependents, so adoption risk is high. The June 2024 to present gap has been broken and a new external contributor appeared, but that is weak evidence of life rather than a support commitment. There is no downstream validation, so treat it as a package to pin and monitor closely.
- What are alternatives to this package for Laravel testing?
- For standard Laravel applications, use PHPUnit or Pest with RefreshDatabase, model factories, and seeders, plus Dusk or Playwright for browser-level coverage. If you must use Behat with Doctrine, loading Doctrine data fixtures through a small custom Behat context may be more transparent than depending on this package. Choose this package only when Behat and Doctrine ORM are already justified requirements.