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

Phpunit Data Provider Laravel Package

rawr/phpunit-data-provider

PHPUnit data provider helper for PHP tests. Simplifies building and organizing datasets, supports readable, reusable providers, and makes parameterized tests easier to maintain. Works with PHPUnit to generate cases cleanly and consistently.

View on GitHub
Deep Wiki
Context7
3.3.0

We added method DataProvider.entries(), which can be used to pass both the key and the value from array rows. It's useful for using already existing collections, of which their keys should also be passed to the test cases.

Test cases are being called with two arguments, the first being the key from the array, and the other being the value (regardless of the value type).

More features will be coming, in current beta there are: DataProvider.filter(), DataProvider.reindex(), DataProvider.reindexTo(), DataProvider.flatMap() and some others.

3.1.0

We added method DataProvider.map(), which can be used to map row's values to any other values. It's useful for separating content of the data provider from the form (if the form is non-trivial) and for adapting similar DataProviders to be used in more tests.

More features will be coming, in current beta there are: DataProvider.filter(), DataProvider.reindex(), DataProvider.reindexTo() and some others.

3.0.0

In march this years, we started rewriting the library, inspired by one of our contributors pull requests: https://github.com/t-regx/phpunit-data-provider/pull/54. As always, it appeared to be a weekend job, but took 5 months. We had 3 iterations of revamps of the library, swaping features, checking what works and what doesn't. The orginal gist of the library stays the same of course - seamless usage of PhpUnit data providers, but now with super powers.

This is what we came up with:

DataProvider::list() DataProvider::join() DataProvider::zip() DataProvider::cross() DataProvider::pairs() DataProvider::of() DataProvider::tuples() DataProvider::dictionary()

Additionally: all DataProvider accepts iterable, properly names each row, always preserves duplicates, differentiates between types (int 4 and string "4") and uses helpful exception messages

The changes are released as 3.0.0 and can be used right away.

We're excited to see how the new library will be used!

Migration from previous version

To use version 3.0.0, migrating from 2.4.0 or earlier:

  • Library namespace changed from \TRegx\DataProvider\ to \TRegx\PhpUnit\DataProviders\ .
  • Change \TRegx\DataProvider\DataProviders::cross() to \TRegx\PhpUnit\DataProviders\DataProvider::cross().
  • Change \TRegx\DataProvider\CrossDataProviders::cross() to \TRegx\PhpUnit\DataProviders\DataProvider::cross().
  • Change your data providers return type from array to iterable or \TRegx\PhpUnit\DataProviders\DataProvider.
  • Removed \TRegx\DataProvider\CrossDataProviders::builder(), use \TRegx\PhpUnit\DataProviders\DataProvider::cross() instead.
1.0.0

First release of a small, handy tool for PhpUnit @dataProviders that's used by T-Regx in require-dev; but of course you can use it with any PhpUnit framework or application :)

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport