Skip to content
This repository has been archived by the owner on Jan 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #326 from ergebnis/feature/boolean-provider
Browse files Browse the repository at this point in the history
Enhancement: Implement BooleanProvider
  • Loading branch information
ergebnis-bot committed Oct 3, 2020
2 parents 084669a + 1d31cb4 commit 4c423af
Show file tree
Hide file tree
Showing 14 changed files with 770 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integrate.yaml
Expand Up @@ -11,7 +11,7 @@ on: # yamllint disable-line rule:truthy
env:
ERGEBNIS_BOT_NAME: "ergebnis-bot"
MIN_COVERED_MSI: 95
MIN_MSI: 95
MIN_MSI: 91
PHP_EXTENSIONS: "mbstring"

jobs:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

For a full diff see [`1.1.0...main`][1.1.0...main].

### Added

* Added `DataProvider\BooleanProvider` ([#326]), by [@localheinz]

## [`1.1.0`][1.1.0]

For a full diff see [`1.0.1...1.1.0`][1.0.1...1.1.0].
Expand Down Expand Up @@ -108,6 +112,7 @@ For a full diff see [`0.7.0...0.8.0`][0.7.0...0.8.0].
[#155]: https://github.com/ergebnis/test-util/pull/155
[#295]: https://github.com/ergebnis/test-util/pull/295
[#302]: https://github.com/ergebnis/test-util/pull/302
[#326]: https://github.com/ergebnis/test-util/pull/326

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
MIN_COVERED_MSI:=95
MIN_MSI:=95
MIN_MSI:=91

.PHONY: it
it: coding-standards static-code-analysis tests ## Runs the coding-standards, static-code-analysis, and tests targets
Expand Down
22 changes: 19 additions & 3 deletions README.md
Expand Up @@ -11,7 +11,7 @@
[![Latest Stable Version](https://poser.pugx.org/ergebnis/test-util/v/stable)](https://packagist.org/packages/ergebnis/test-util)
[![Total Downloads](https://poser.pugx.org/ergebnis/test-util/downloads)](https://packagist.org/packages/ergebnis/test-util)

Provides utilities for tests.
Provides a helper trait and generic data providers for tests.

## Installation

Expand All @@ -23,6 +23,8 @@ $ composer require --dev ergebnis/test-util

## Usage

### `Helper`

Import the `Ergebnis\Test\Util\Helper` trait into your test class:

```php
Expand All @@ -41,7 +43,7 @@ final class BazTest extends Framework\TestCase
}
```

### Easy access to localized instances of `Faker\Generator`
#### Easy access to localized instances of `Faker\Generator`

The `Helper` trait provides a method to fetch a localized instance of `Faker\Generator`:

Expand Down Expand Up @@ -75,7 +77,7 @@ final class PlayerTest extends Framework\TestCase

For reference, see [`fzaninotto/faker`](https://github.com/fzaninotto/Faker).

### Additional Assertions
#### Additional Assertions

In addition to the assertions made available by extending from `PHPUnit\Framework\TestCase`, the `Helper` trait provides the following assertions:

Expand All @@ -95,6 +97,20 @@ In addition to the assertions made available by extending from `PHPUnit\Framewor
* `assertTraitExists(string $traitName)`
* `assertTraitSatisfiesSpecification(callable $specification, string $traitName, string $message = '')`

### Data Providers

This package provides the following generic data providers:

* [`Ergebnis\Test\Util\DataProvider\BooleanProvider`](https://github.com/ergebnis/test-util#dataproviderbooleanprovider)

#### `DataProvider\BooleanProvider`

* `arbitrary()` provides `true`, `false`
* `false()` provides `false`
* `true()` provides `true`

For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\BooleanProviderTest`](test/Unit/DataProvider/BooleanProviderTest.php).

## Changelog

Please have a look at [`CHANGELOG.md`](CHANGELOG.md).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
@@ -1,7 +1,7 @@
{
"name": "ergebnis/test-util",
"type": "library",
"description": "Provides utilities for tests.",
"description": "Provides a helper trait and generic data providers for tests.",
"keywords": [
"assertion",
"faker",
Expand Down

0 comments on commit 4c423af

Please sign in to comment.