codeception/specify
BDD-style specifications for PHP tests, built as a lightweight extension for Codeception. Adds a clean “specify” syntax to structure examples and expectations, making tests easier to read, write, and maintain across unit and functional suites.
codeception/specify) enables BDD-style syntax (e.g., describe(), it(), beforeEach()) for PHPUnit/Codeception, aligning well with modern PHP testing paradigms. This improves readability and maintainability for behavior-driven tests, especially in Laravel where feature tests are critical.beforeEach()/afterEach(), which is valuable for Laravel’s dependency-heavy test suites (e.g., mocking services, database transactions).phpunit.xml and Codeception’s cept.php configurations. No breaking changes to existing test runners.specify doesn’t conflict with existing BDD extensions (e.g., codeception/specify vs. codeception/bdd).public function testX() to it('does X')).specify may not justify adoption.specify for new tests while grandfathering legacy PHPUnit tests.specify syntax.composer.json:
"require-dev": {
"codeception/specify": "^1.0"
}
phpunit.xml includes:
<autoload>
<classmap>
<dir>./tests</dir>
</classmap>
</autoload>
dataProvider changes).specify doesn’t override existing BDD modules. Check for namespace collisions.codeception/specify to a specific version (e.g., ^1.0) to avoid breaking changes.specify obsolete.specify internals, complicating error resolution.describe blocks).phpunit --parallel).| Risk | Mitigation Strategy |
|---|---|
| PHPUnit version incompatibility | Pin specify version; test with Laravel’s PHPUnit. |
| Test flakiness from BDD syntax | Enforce strict test isolation (e.g., no shared state). |
| Package abandonment | Fork and maintain; evaluate Pest as alternative. |
| CI/CD pipeline breaks | Add specify to test matrix early. |
setUp methods).How can I help you explore Laravel packages today?