PHPackages                             codekandis/phpunit - 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. codekandis/phpunit

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

codekandis/phpunit
==================

`codekandis/phpunit` is a library providing several wrapper and helper classes for the package `PHPUnit`.

5.0.0(7mo ago)053520MITPHPPHP &gt;=8.4CI failing

Since Dec 27Pushed 5d ago1 watchersCompare

[ Source](https://github.com/codekandis/phpunit)[ Packagist](https://packagist.org/packages/codekandis/phpunit)[ RSS](/packages/codekandis-phpunit/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (20)

codekandis/phpunit
==================

[](#codekandisphpunit)

[![Version](https://camo.githubusercontent.com/f8a72d53c46b727f2660924d9456fb7cdba99af9e46ce31d5494cb49788267b7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d352e302e302d626c75652e737667)](./CHANGELOG.md)[![License](https://camo.githubusercontent.com/07a7d0169027aac6d7a0bfa8964dfef5fbc40d5a2075cabb3d8bc67e17be3451/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d79656c6c6f772e737667)](./LICENSE)[![Minimum PHP Version](https://camo.githubusercontent.com/db2abc4c99337a799d57b191c749e512b551eaebf6ce7c37e0ea9eac2eb1b9f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e342d3838393242462e737667)](https://php.net)

This library provides several wrappers and helper classes for the package [`phpunit/phpunit`](https://packagist.org/packages/phpunit/phpunit).

Index
-----

[](#index)

- [Installation](#installation)
- [How to use](#how-to-use)
    - [Using the test case wrapper](#using-the-test-case-wrapper)
    - [Using the data provider interface](#using-the-data-provider-interface)

Installation
------------

[](#installation)

Install the latest version with

```
$ composer require --dev codekandis/phpunit
```

How to use
==========

[](#how-to-use)

Using the test case wrapper
---------------------------

[](#using-the-test-case-wrapper)

Create a new test case and inherit it from the wrapper `TestCase`.

```
class FooTest extends TestCase
{
}
```

Using the data provider interface
---------------------------------

[](#using-the-data-provider-interface)

Create a new data provider and implement the interface `DataProviderInterface`.

```
class ImportantStuffDataProvider implements DataProviderInterface
{
  #[Override]
  public static function provideData(): iterable
  {
    return [
      0 => [
        23,
        42
      ],
      1 => [
        'foo',
        'bar'
      ]
    ];
  }
}
```

Use the data provider in your test case.

```
