Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codekandis/phpunit
`codekandis/phpunit` is a library providing several wrapper and helper classes for the package `PHPUnit`.
https://github.com/codekandis/phpunit
classes helper php phpunit wrapper
Last synced: about 2 months ago
JSON representation
`codekandis/phpunit` is a library providing several wrapper and helper classes for the package `PHPUnit`.
- Host: GitHub
- URL: https://github.com/codekandis/phpunit
- Owner: codekandis
- License: mit
- Created: 2019-12-27T13:34:01.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-02-13T21:29:36.000Z (12 months ago)
- Last Synced: 2024-03-14T23:07:21.853Z (11 months ago)
- Topics: classes, helper, php, phpunit, wrapper
- Language: PHP
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# codekandis/phpunit
[![Version][xtlink-version-badge]][srclink-changelog]
[![License][xtlink-license-badge]][srclink-license]
[![Minimum PHP Version][xtlink-php-version-badge]][xtlink-php-net]This library provides several wrappers and helper classes for the package [`phpunit/phpunit`][xtlink-packagist-phpunit-phpunit].
## 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
Install the latest version with
```bash
$ composer require --dev codekandis/phpunit
```# How to use
## Using the test case wrapper
Create a new test case and inherit it from the wrapper `TestCase`.
```php
class FooTest extends TestCase
{
}
```## Using the data provider interface
Create a new data provider and implement the interface `DataProviderInterface`.
```php
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.
```php