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
Phpspec Data Provider Extension

Phpspec Data Provider Extension Laravel Package

coduo/phpspec-data-provider-extension

PHPSpec extension adding data providers to run the same specification with multiple input/output datasets. Define examples in your specs for concise, parameterized tests and cleaner coverage of edge cases without duplicating scenarios.

View on GitHub
Deep Wiki
Context7

This extension allows you to create data providers for examples in specs.

Frequently asked questions about Phpspec Data Provider Extension
Can I use this package with Laravel’s default PHPUnit for testing?
No, this package extends PhpSpec, not PHPUnit. Laravel primarily uses PHPUnit, so unless your team already relies on PhpSpec for BDD testing, this won’t integrate seamlessly. Consider PHPUnit’s built-in `@dataProvider` instead.
Does this work with Laravel 9+ or PHP 8.x?
No, the package was last updated in 2015 and only supports PHP 5.6–7.0. It lacks compatibility with PHP 8.x features like named arguments or attributes, making it unsuitable for modern Laravel stacks. A fork would be required for updates.
How do I install and configure this in a Laravel project?
Run `composer require coduo/phpspec-data-provider-extension`, then enable it in `phpspec.yml` under `extensions`. However, note that PhpSpec 2.x (required) is incompatible with Laravel’s default testing tools, so you’d need to run it separately.
What’s the advantage over PHPUnit’s `@dataProvider`?
This package offers a PhpSpec-specific syntax for data-driven tests, which may feel more natural if your team uses BDD workflows. However, PHPUnit’s `@dataProvider` achieves the same goal without requiring a secondary testing framework.
Will this break my existing Laravel test suite?
Yes, mixing PhpSpec and PHPUnit can cause conflicts, especially with Laravel’s testing helpers (e.g., `RefreshDatabase`). The package introduces a separate test runner, increasing complexity and potential inconsistencies in assertions or mocking.
Is there a way to use this without downgrading Laravel’s PHPUnit?
No, this package requires PhpSpec 2.x, which is abandoned and incompatible with modern Laravel’s PHPUnit. You’d either need to run PhpSpec in isolation or migrate to PHPUnit’s alternatives, like `@dataProvider` or packages like `vladmerin/data-provider`.
How do I write parameterized tests with this package?
Define a data provider method (e.g., `positiveConversionExamples()`) returning an array of test cases, then annotate your spec method with `@dataProvider`. Each test case runs as a separate example, reducing boilerplate for edge cases.
Does this support Laravel’s testing utilities like `RefreshDatabase`?
No, this package is framework-agnostic and only works with PhpSpec. Laravel’s testing utilities (e.g., `RefreshDatabase`, `ActingAs`) are PHPUnit-specific and won’t integrate with this extension.
What are the risks of using this in production?
The package is archived with no updates since 2015, posing risks like PHP 8.x incompatibility, security vulnerabilities, and breaking changes. Modern Laravel projects should prioritize PHPUnit’s built-in solutions or maintained alternatives.
Can I contribute to update this for PHP 8.x?
Yes, but it’s a high-effort task due to PhpSpec 2.x’s abandonment. You’d need to fork the repo, update dependencies, and ensure compatibility with Laravel’s ecosystem. Weigh the effort against alternatives like PHPUnit’s `@dataProvider`.
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.
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
christhompsontldr/laravel-inky
spatie/mailcoach-vapor