PHPackages                             yuraplohov/test-data-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. yuraplohov/test-data-provider

ActiveLibrary[Testing &amp; Quality](/categories/testing)

yuraplohov/test-data-provider
=============================

Providing test data for autotests from php files with returned arrays, and from any text files

1.2(2y ago)02.4kMITPHPPHP &gt;=8.0

Since Mar 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yuraplohov/test-data-provider)[ Packagist](https://packagist.org/packages/yuraplohov/test-data-provider)[ RSS](/packages/yuraplohov-test-data-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

yuraplohov/test-data-provider
-----------------------------

[](#yuraplohovtest-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
------------

[](#installation)

```
composer require yuraplohov/test-data-provider
```

Usage
-----

[](#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:

```
