Download the PHP package yuraplohov/test-data-provider without Composer

On this page you can find all versions of the php package yuraplohov/test-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 test-data-provider

yuraplohov/test-data-provider

The package provides data for autotests from php-files with returned arrays, and from any text files (json, xml, txt...). The package works with PHPUnit, Codeception and Pest frameworks.

Installation

Usage

The package contains one class - Yuraplohov\TestDataProvider\Provider. This class has four public methods:

  1. basePath(string $basePath): self - sets the base path to the directory with data.
  2. getPHPUnitCases(array $caseDirs): array - retrieves an array of test cases in PHPUnit framework format.
  3. getCodeceptionCases(array $caseDirs): array - retrieves an array of test cases in Codeception framework format.
  4. get(string $path): mixed - retrieves data from a directory, file, or array element in a php-file.

Php files with data for all these methods should be like this:

Also, all three methods can work with any text files (json, xml, txt...). The content of such files is returned as a string without any transformations.

The 'tests' directory structure for getPHPUnitCases() and getCodeceptionCases() methods could be:

If the base path is not specified, the 'data' directory must be at the same level as your test class. Directories with cases are placed in the 'data' directory. You can name case directories whatever you want, but the 'data' directory must always be named like this if you don't specify any base path with basePath().

Provider::getPHPUnitCases(array $caseDirs): array

Provider::getCodeceptionCases(array $caseDirs): array

Provider::get(string $path): mixed

This method can be used with any framework and with any structure of the 'data' directory.

Tests directory structure example:

Examples of method calling for this structure:

Usage in PHPUnit:

Testing

License

The MIT License (MIT).


All versions of test-data-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=8.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 yuraplohov/test-data-provider contains the following files

Loading the files please wait ....