Download the PHP package rawr/phpunit-data-provider without Composer

On this page you can find all versions of the php package rawr/phpunit-data-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpunit-data-provider

Helper for PhpUnit @dataProvider

Handy require-dev testing tool for PhpUnit. It allows to manage data providers with zip(), join(), cross(), pairs(), slice(), map() and more.

Build Status Coverage Status Dependencies License Composer lock

PHP Version PHP Version PHP Version PHP Version PHP Version PHP Version PHP Version

PRs Welcome

  1. Installation
    • Composer
  2. Overview
    • DataProvider::list()
    • DataProvider::join()
    • DataProvider::zip()
    • DataProvider::cross()
    • DataProvider::pairs()
    • DataProvider::of()
    • DataProvider::tuples()
    • DataProvider::dictionary()
    • DataProvider.map()
    • DataProvider.slice()
    • DataProvider.entries()
  3. Documentation
    • Functionalities
    • Features
    • Example
    • Advanced example
  4. Migration

Installation

Installation for PHP 7.1 and later:

Overview

DataProvider can be used to build, compose and edit data providers to be used with PhpUnit by @sebastianbergmann.

DataProvider::list()

DataProvider::list() provides a list of elements. Test is invoked each time with a single argument.

Additionally, DataProvider::list() names rows based on values.

DataProvider::join()

Vertically join data providers together.

💡 Useful when two data providers are used in other tests, and a new test should use both of them.

Note:

DataProvider::zip()

Horizontally join data providers together.

💡 Useful for keeping data providers clean and simple.

Note:

DataProvider::cross()

Creates a square matrix of given data providers.

💡 Useful for testing all combinations of arguments.

DataProvider::pairs()

Calls test with two arguments. Each argument is paired with all of the other arguments. All rows are named according to the arguments.

Example shows a test paring image formats:

DataProvider::of()

Instantiates a DataProvider from a raw-array accepted by PhpUnit.

Notes:

DataProvider::tuples()

Provide multiple arguments for each a test. DataProvider::tuples() names each row based on the values.

DataProvider::dictionary()

Specify a single argument for test. names each row based on the provided array key.

In most cases, name rows based on arguments. Method DataProvider::dictionary() is useful when the arguments are not self-explanatory:

DataProvider.map()

Transform each row's values in DataProvider to any other set of values.

💡 Useful for separating providers content and their form.

Notes:

DataProvider.slice()

Remove leading or trailing rows from DataProvider.

💡 Useful for adapting DataProvider to be zipped or limit provided values.

DataProvider.entries()

Provide two arguments for each a test, from key-value pairs. DataProvider::entries() names each row based on the key-value pair.

Documentation

Functionalities

Features

Names

DataProvider sets proper names for each row based on values.

Example usage

DataProvider::cross() returns an instance of DataProvider which is a square matrix of input data providers.

This is equivalent of having a regular data provider that is composed of 12 entries, similar to:

DataProvider::cross() accepts data providers of different types: array, \Iterator, \IteratorAggregate, \Traversable, \Generator, iterable and DataProvider.

That means DataProvider can be composed together.

Advanced usage

DataProvider can be combined with other DataProviders as well as regular PhpUnit data providers.

Accepted types

DataProvider accepts any type of data provider:

Notes

Notes on DataProvider::join():

Notes on DataProvider::zip():

Note on DataProvider::pairs():

Note on DataProvider::tuples():

Migration from previous version

To use version 3.0.0, migrating from 2.4.0 or earlier:


All versions of phpunit-data-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rawr/phpunit-data-provider contains the following files

Loading the files please wait ....