Download the PHP package soyhuce/array-factory without Composer
On this page you can find all versions of the php package soyhuce/array-factory. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download soyhuce/array-factory
More information about soyhuce/array-factory
Files in soyhuce/array-factory
Package array-factory
Short Description This is my package array-factory
License MIT
Homepage https://github.com/soyhuce/array-factory
Informations about the package array-factory
This is array-factory package
When testing your application, you may need to write the same data structures (lists, collections, Etc.) to populate models or something else. These often duplicated in multiple test files.
A bit like Laravel's Factory classes, ArrayFactory permits to generate and reuse custom data structures and usable among your tests.
Installation
You can install the package via composer:
Usage
Create a factory
Use it
Add states
You may need to define states and use it in a specific context.
Add custom Collection
You can transform the array into a custom Collection.
You can also transform the array into a custom Data object by defining the Spatie\LaravelData\Data class.
Add custom \Spatie\LaravelData\Data
It allows get many results as collection of datas
Create an extended class
Then, you can simply use it in your tests.
Testing
Runs tests.
Runs all pre-commit checks.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Bastien Philippe
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of array-factory with dependencies
illuminate/collections Version ^11.0|^12.0
illuminate/database Version ^11.0|^12.0
illuminate/pipeline Version ^11.0|^12.0