From 27ee2ed5fe35231fa872ed6869c39f34da1b0323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 3 Jan 2022 19:36:03 +0100 Subject: [PATCH] Fix: Remove data providers --- CHANGELOG.md | 25 +- README.md | 106 +- phpstan-baseline.neon | 1108 ----------------- psalm-baseline.xml | 190 --- src/DataProvider/BoolProvider.php | 64 - src/DataProvider/FloatProvider.php | 109 -- src/DataProvider/IntProvider.php | 109 -- src/DataProvider/NullProvider.php | 35 - src/DataProvider/ObjectProvider.php | 35 - src/DataProvider/ResourceProvider.php | 35 - src/DataProvider/StringProvider.php | 181 --- .../DataProvider/AbstractProviderTestCase.php | 116 -- test/Unit/DataProvider/BoolProviderTest.php | 89 -- test/Unit/DataProvider/FloatProviderTest.php | 172 --- test/Unit/DataProvider/IntProviderTest.php | 172 --- test/Unit/DataProvider/NullProviderTest.php | 46 - test/Unit/DataProvider/ObjectProviderTest.php | 46 - .../DataProvider/ResourceProviderTest.php | 48 - test/Unit/DataProvider/StringProviderTest.php | 177 --- .../DataProvider/Specification/Closure.php | 38 - .../Util/DataProvider/Specification/Equal.php | 34 - .../DataProvider/Specification/Identical.php | 34 - .../DataProvider/Specification/Pattern.php | 38 - .../Specification/Specification.php | 19 - 24 files changed, 23 insertions(+), 3003 deletions(-) delete mode 100644 src/DataProvider/BoolProvider.php delete mode 100644 src/DataProvider/FloatProvider.php delete mode 100644 src/DataProvider/IntProvider.php delete mode 100644 src/DataProvider/NullProvider.php delete mode 100644 src/DataProvider/ObjectProvider.php delete mode 100644 src/DataProvider/ResourceProvider.php delete mode 100644 src/DataProvider/StringProvider.php delete mode 100644 test/Unit/DataProvider/AbstractProviderTestCase.php delete mode 100644 test/Unit/DataProvider/BoolProviderTest.php delete mode 100644 test/Unit/DataProvider/FloatProviderTest.php delete mode 100644 test/Unit/DataProvider/IntProviderTest.php delete mode 100644 test/Unit/DataProvider/NullProviderTest.php delete mode 100644 test/Unit/DataProvider/ObjectProviderTest.php delete mode 100644 test/Unit/DataProvider/ResourceProviderTest.php delete mode 100644 test/Unit/DataProvider/StringProviderTest.php delete mode 100644 test/Util/DataProvider/Specification/Closure.php delete mode 100644 test/Util/DataProvider/Specification/Equal.php delete mode 100644 test/Util/DataProvider/Specification/Identical.php delete mode 100644 test/Util/DataProvider/Specification/Pattern.php delete mode 100644 test/Util/DataProvider/Specification/Specification.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 8858492..7ed9b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## Unreleased -For a full diff see [`1.6.0...main`][1.6.0...main]. +For a full diff see [`2.0.0...main`][2.0.0...main]. + +## [`2.0.0`][2.0.0] + +For a full diff see [`1.6.0...2.0.0`][1.6.0...2.0.0]. + +### Removed + +- Removed all data providers ([#552]), by [@localheinz] + + If you use any of the data providers, run + + ```shell + composer require --dev ergebnis/data-provider + ``` + + and replace occurrences of `Ergebnis\Test\Util\DataProvider` with `Ergebnis\DataProvider`. ## [`1.6.0`][1.6.0] @@ -129,7 +145,7 @@ For a full diff see [`0.8.0...0.9.0`][0.8.0...0.9.0]. $ find . -type f -exec sed -i '.bak' 's/Localheinz\\Test\\Util/Ergebnis\\Test\\Util/g' {} \; ``` - to replace occurrences of `Localheinz\Test\Util` with `Ergebnis\Test\Util`. + to replace occurrences of `Ergebnis\Test\Util` with `Ergebnis\Test\Util`. Run @@ -162,6 +178,7 @@ For a full diff see [`0.7.0...0.8.0`][0.7.0...0.8.0]. [1.4.0]: https://github.com/ergebnis/test-util/releases/tag/1.4.0 [1.5.0]: https://github.com/ergebnis/test-util/releases/tag/1.5.0 [1.6.0]: https://github.com/ergebnis/test-util/releases/tag/1.6.0 +[2.0.0]: https://github.com/ergebnis/test-util/releases/tag/2.0.0 [0.7.0...0.8.0]: https://github.com/ergebnis/test-util/compare/0.7.0...0.8.0 [0.8.0...0.9.0]: https://github.com/ergebnis/test-util/compare/0.8.0...0.9.0 @@ -175,7 +192,8 @@ For a full diff see [`0.7.0...0.8.0`][0.7.0...0.8.0]. [1.3.1...1.4.0]: https://github.com/ergebnis/test-util/compare/1.3.1...1.4.0 [1.4.0...1.5.0]: https://github.com/ergebnis/test-util/compare/1.4.0...1.5.0 [1.5.0...1.6.0]: https://github.com/ergebnis/test-util/compare/1.5.0...1.6.0 -[1.6.0...main]: https://github.com/ergebnis/test-util/compare/1.6.0...main +[1.6.0...2.0.0]: https://github.com/ergebnis/test-util/compare/1.6.0...2.0.0 +[2.0.0...main]: https://github.com/ergebnis/test-util/compare/2.0.0...main [#118]: https://github.com/ergebnis/test-util/pull/118 [#119]: https://github.com/ergebnis/test-util/pull/119 @@ -202,6 +220,7 @@ For a full diff see [`0.7.0...0.8.0`][0.7.0...0.8.0]. [#540]: https://github.com/ergebnis/test-util/pull/540 [#548]: https://github.com/ergebnis/test-util/pull/548 [#549]: https://github.com/ergebnis/test-util/pull/549 +[#552]: https://github.com/ergebnis/test-util/pull/552 [@dependabot]: https://github.com/dependabot [@ergebnis]: https://github.com/ergebnis diff --git a/README.md b/README.md index 9457f75..851a624 100644 --- a/README.md +++ b/README.md @@ -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 a helper trait and generic data providers for tests. +Provides a helper trait for tests. ## Installation @@ -99,110 +99,6 @@ In addition to the assertions made available by extending from `PHPUnit\Framewor * `assertTraitExists(string $traitName)` * `assertTraitSatisfiesSpecification(callable $specification, string $traitName, string $message = '')` -### Data Providers - -:exclamation: The data providers have been deprecated. Use [`ergebnis/data-provider`](https://github.com/ergebnis/data-provider) instead. - -This package provides the following generic data providers: - -* [`Ergebnis\Test\Util\DataProvider\BoolProvider`](https://github.com/ergebnis/test-util#dataproviderboolprovider) -* [`Ergebnis\Test\Util\DataProvider\FloatProvider`](https://github.com/ergebnis/test-util#dataproviderfloatprovider) -* [`Ergebnis\Test\Util\DataProvider\IntProvider`](https://github.com/ergebnis/test-util#dataproviderintprovider) -* [`Ergebnis\Test\Util\DataProvider\NullProvider`](https://github.com/ergebnis/test-util#dataprovidernullprovider) -* [`Ergebnis\Test\Util\DataProvider\ObjectProvider`](https://github.com/ergebnis/test-util#dataproviderobjectprovider) -* [`Ergebnis\Test\Util\DataProvider\ResourceProvider`](https://github.com/ergebnis/test-util#dataproviderresourceprovider) -* [`Ergebnis\Test\Util\DataProvider\StringProvider`](https://github.com/ergebnis/test-util#dataproviderstringprovider) - -Since it is possible to use multiple `@dataProvider` annotations for test methods, these generic data providers allow for reuse and composition of data providers: - -```php -expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Value can not be an empty or blank string.'); - - UserName::fromString($value); - } -} -``` - -#### `DataProvider\BoolProvider` - -* `arbitrary()` provides `true`, `false` -* `false()` provides `false` -* `true()` provides `true` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\BoolProviderTest`](test/Unit/DataProvider/BoolProviderTest.php). - -#### `DataProvider\FloatProvider` - -* `arbitrary()` provides arbitrary `float`s -* `greaterThanOne()` provides `int`s greater than `1.0` -* `greaterThanZero()` provides `int`s greater than `0.0` -* `lessThanOne()` provides `int`s less than `1.0` -* `lessThanZero()` provides `int`s less than `0.0` -* `one()` provides `1.0` -* `zero()` provides `0.0` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\FloatProviderTest`](test/Unit/DataProvider/FloatProviderTest.php). - -#### `DataProvider\IntProvider` - -* `arbitrary()` provides arbitrary `int`s -* `greaterThanOne()` provides `int`s greater than `1` -* `greaterThanZero()` provides `int`s greater than `0` -* `lessThanOne()` provides `int`s less than `1` -* `lessThanZero()` provides `int`s less than `0` -* `one()` provides `1` -* `zero()` provides `0` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\IntProviderTest`](test/Unit/DataProvider/IntProviderTest.php). - -#### `DataProvider\NullProvider` - -* `null()` provides `null` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\NullProviderTest`](test/Unit/DataProvider/NullProviderTest.php). - -#### `DataProvider\ObjectProvider` - -* `object()` provides an instance of `stdClass` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\ObjectProviderTest`](test/Unit/DataProvider/ObjectProviderTest.php). - -#### `DataProvider\ResourceProvider` - -* `resource()` provides a `resource` - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\ResourceProviderTest`](test/Unit/DataProvider/ResourceProviderTest.php). - -#### `DataProvider\StringProvider` - -* `arbitrary()` provides arbitrary `string`s -* `blank()` provides `string`s consisting of whitespace characters only -* `empty()` provides an empty `string` -* `trimmed()` provides non-empty, non-blank `strings` without leading and trailing whitespace -* `untrimmed()` provides non-empty, non-blank `string`s with additional leading and trailing whitespace -* `withWhitespace()` provides non-empty, non-blank, trimmed `string`s containing whitespace - -For examples, see [`Ergebnis\Test\Util\Test\Unit\DataProvider\StringProviderTest`](test/Unit/DataProvider/StringProviderTest.php). - ## Changelog Please have a look at [`CHANGELOG.md`](CHANGELOG.md). diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index d09dce0..7669858 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,1058 +1,5 @@ parameters: ignoreErrors: - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/BoolProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/FloatProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/IntProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/IntProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/NullProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/NullProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ObjectProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/ResourceProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertContains\\(\\)\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertEmpty\\(\\)\\.$#" - count: 2 - path: src/DataProvider/StringProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertIsArray\\(\\)\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Call to an undefined static method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertTrue\\(\\)\\.$#" - count: 11 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassImplementsInterface\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassIsAbstract\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassIsFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassUsesTrait\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassesAreAbstractOrFinal\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassesHaveTests\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertClassyConstructsSatisfySpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertInterfaceExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertInterfaceExtends\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertInterfaceSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertTraitExists\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:assertTraitSatisfiesSpecification\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:faker\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:provideDataForValues\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:provideDataForValuesWhere\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\:\\:provideDataForValuesWhereNot\\(\\) is protected, but since the containing class is final, it can be private\\.$#" - count: 1 - path: src/DataProvider/StringProvider.php - - - - message: - """ - #^Call to deprecated method provideDataForValues\\(\\) of class Ergebnis\\\\Test\\\\Util\\\\Test\\\\Unit\\\\DataProvider\\\\AbstractProviderTestCase\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/AbstractProviderTestCase.php - - - - message: "#^Call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertIsArray\\(\\) with array and non\\-empty\\-string will always evaluate to true\\.$#" - count: 1 - path: test/Unit/DataProvider/AbstractProviderTestCase.php - - - - message: - """ - #^Call to method arbitrary\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/BoolProviderTest.php - - - - message: - """ - #^Call to method false\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/BoolProviderTest.php - - - - message: - """ - #^Call to method true\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\BoolProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/BoolProviderTest.php - - - - message: - """ - #^Call to method arbitrary\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method greaterThanOne\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method greaterThanZero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method lessThanOne\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method lessThanZero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method one\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method zero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\FloatProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/FloatProviderTest.php - - - - message: - """ - #^Call to method arbitrary\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method greaterThanOne\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method greaterThanZero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method lessThanOne\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method lessThanZero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method one\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method zero\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\IntProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/IntProviderTest.php - - - - message: - """ - #^Call to method null\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\NullProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/NullProviderTest.php - - - - message: - """ - #^Call to method object\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ObjectProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/ObjectProviderTest.php - - - - message: - """ - #^Call to method resource\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\ResourceProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/ResourceProviderTest.php - - - - message: - """ - #^Call to method arbitrary\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - - - message: - """ - #^Call to method blank\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - - - message: - """ - #^Call to method empty\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - - - message: - """ - #^Call to method trimmed\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - - - message: - """ - #^Call to method untrimmed\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - - - message: - """ - #^Call to method withWhitespace\\(\\) of deprecated class Ergebnis\\\\Test\\\\Util\\\\DataProvider\\\\StringProvider\\: - use ergebnis/data\\-provider instead$# - """ - count: 1 - path: test/Unit/DataProvider/StringProviderTest.php - - message: """ @@ -1811,58 +758,3 @@ parameters: count: 1 path: test/Unit/HelperTest.php - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Closure\\:\\:isSatisfiedBy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Closure.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Equal\\:\\:__construct\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Equal.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Equal\\:\\:create\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Equal.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Equal\\:\\:isSatisfiedBy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Equal.php - - - - message: "#^Property Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Equal\\:\\:\\$value has no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Equal.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Identical\\:\\:__construct\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Identical.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Identical\\:\\:create\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Identical.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Identical\\:\\:isSatisfiedBy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Identical.php - - - - message: "#^Property Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Identical\\:\\:\\$value has no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Identical.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Pattern\\:\\:isSatisfiedBy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Pattern.php - - - - message: "#^Method Ergebnis\\\\Test\\\\Util\\\\Test\\\\Util\\\\DataProvider\\\\Specification\\\\Specification\\:\\:isSatisfiedBy\\(\\) has parameter \\$value with no typehint specified\\.$#" - count: 1 - path: test/Util/DataProvider/Specification/Specification.php - diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 847fa96..5022088 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,77 +1,5 @@ - - - self::provideDataForValues(self::values()) - - - \Generator<string, array{0: bool}> - \Generator<string, array{0: bool}> - \Generator<string, array{0: bool}> - - - true === $value - - - - - self::provideDataForValues(self::values()) - - - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - \Generator<string, array{0: float}> - - - - - self::provideDataForValues(self::values()) - - - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - \Generator<string, array{0: int}> - - - - - - \Generator<string, array{0: null}> - - - - - - \Generator<string, array{0: bool}> - - - - - - \Generator<string, array{0: resource}> - - - - - self::provideDataForValues(self::values()) - - - \Generator<string, array{0: string}> - \Generator<string, array{0: string}> - \Generator<string, array{0: string}> - \Generator<string, array{0: string}> - \Generator<string, array{0: string}> - \Generator<string, array{0: string}> - - self::assertClassExists($className) @@ -97,9 +25,6 @@ $value - - self::assertIsArray($usedTraitNames) - class-string class-string @@ -110,77 +35,6 @@ class-string - - - self::provideDataForValues($values) - - - $value - - - assertIsArray - - - Util\Test\Util\DataProvider\Specification\Specification - - - - - BoolProvider::arbitrary() - BoolProvider::false() - BoolProvider::true() - - - - - FloatProvider::arbitrary() - FloatProvider::greaterThanOne() - FloatProvider::greaterThanZero() - FloatProvider::lessThanOne() - FloatProvider::lessThanZero() - FloatProvider::one() - FloatProvider::zero() - - - - - IntProvider::arbitrary() - IntProvider::greaterThanOne() - IntProvider::greaterThanZero() - IntProvider::lessThanOne() - IntProvider::lessThanZero() - IntProvider::one() - IntProvider::zero() - - - - - NullProvider::null() - - - - - ObjectProvider::object() - - - - - ResourceProvider::resource() - - - $value - - - - - StringProvider::arbitrary() - StringProvider::blank() - StringProvider::empty() - StringProvider::trimmed() - StringProvider::untrimmed() - StringProvider::withWhitespace() - - self::assertClassExtends(\InvalidArgumentException::class, EmptyValues::class) @@ -262,48 +116,4 @@ $classyName - - - $value - - - $value - - - bool - - - $closure($value) - - - - - $value - $value - $value - - - $value - - - - - $value - $value - $value - - - $value - - - - - $value - - - - - $value - - diff --git a/src/DataProvider/BoolProvider.php b/src/DataProvider/BoolProvider.php deleted file mode 100644 index 5d01e64..0000000 --- a/src/DataProvider/BoolProvider.php +++ /dev/null @@ -1,64 +0,0 @@ - - */ - public static function arbitrary(): \Generator - { - yield from self::provideDataForValues(self::values()); - } - - /** - * @return \Generator - */ - public static function false(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (bool $value): bool { - return false === $value; - }); - } - - /** - * @return \Generator - */ - public static function true(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (bool $value): bool { - return true === $value; - }); - } - - /** - * @return array - */ - private static function values(): array - { - return [ - 'bool-false' => false, - 'bool-true' => true, - ]; - } -} diff --git a/src/DataProvider/FloatProvider.php b/src/DataProvider/FloatProvider.php deleted file mode 100644 index 97d13f5..0000000 --- a/src/DataProvider/FloatProvider.php +++ /dev/null @@ -1,109 +0,0 @@ - - */ - public static function arbitrary(): \Generator - { - yield from self::provideDataForValues(self::values()); - } - - /** - * @return \Generator - */ - public static function lessThanZero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 0.0 > $value; - }); - } - - /** - * @return \Generator - */ - public static function zero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 0.0 === $value; - }); - } - - /** - * @return \Generator - */ - public static function greaterThanZero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 0.0 < $value; - }); - } - - /** - * @return \Generator - */ - public static function lessThanOne(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 1.0 > $value; - }); - } - - /** - * @return \Generator - */ - public static function one(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 1.0 === $value; - }); - } - - /** - * @return \Generator - */ - public static function greaterThanOne(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (float $value): bool { - return 1.0 < $value; - }); - } - - /** - * @return array - */ - private static function values(): array - { - $faker = self::faker(); - - return [ - 'float-less-than-minus-one' => -0.01 - $faker->randomFloat(null, 1), - 'float-minus-one' => -1.0, - 'float-zero' => 0.0, - 'float-plus-one' => 1.0, - 'float-greater-than-plus-one' => 0.01 + $faker->randomFloat(null, 1), - ]; - } -} diff --git a/src/DataProvider/IntProvider.php b/src/DataProvider/IntProvider.php deleted file mode 100644 index 6289e30..0000000 --- a/src/DataProvider/IntProvider.php +++ /dev/null @@ -1,109 +0,0 @@ - - */ - public static function arbitrary(): \Generator - { - yield from self::provideDataForValues(self::values()); - } - - /** - * @return \Generator - */ - public static function lessThanZero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 0 > $value; - }); - } - - /** - * @return \Generator - */ - public static function zero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 0 === $value; - }); - } - - /** - * @return \Generator - */ - public static function greaterThanZero(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 0 < $value; - }); - } - - /** - * @return \Generator - */ - public static function lessThanOne(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 1 > $value; - }); - } - - /** - * @return \Generator - */ - public static function one(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 1 === $value; - }); - } - - /** - * @return \Generator - */ - public static function greaterThanOne(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (int $value): bool { - return 1 < $value; - }); - } - - /** - * @return array - */ - private static function values(): array - { - $faker = self::faker(); - - return [ - 'int-less-than-minus-one' => -1 * $faker->numberBetween(1), - 'int-minus-one' => -1, - 'int-zero' => 0, - 'int-plus-one' => 1, - 'int-greater-than-plus-one' => $faker->numberBetween(1), - ]; - } -} diff --git a/src/DataProvider/NullProvider.php b/src/DataProvider/NullProvider.php deleted file mode 100644 index 2db7497..0000000 --- a/src/DataProvider/NullProvider.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - public static function null(): \Generator - { - yield from self::provideDataForValues([ - 'null' => null, - ]); - } -} diff --git a/src/DataProvider/ObjectProvider.php b/src/DataProvider/ObjectProvider.php deleted file mode 100644 index fa32c68..0000000 --- a/src/DataProvider/ObjectProvider.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - public static function object(): \Generator - { - yield from self::provideDataForValues([ - 'object' => new \stdClass(), - ]); - } -} diff --git a/src/DataProvider/ResourceProvider.php b/src/DataProvider/ResourceProvider.php deleted file mode 100644 index 8ca50b9..0000000 --- a/src/DataProvider/ResourceProvider.php +++ /dev/null @@ -1,35 +0,0 @@ - - */ - public static function resource(): \Generator - { - yield from self::provideDataForValues([ - 'resource' => \fopen(__FILE__, 'rb'), - ]); - } -} diff --git a/src/DataProvider/StringProvider.php b/src/DataProvider/StringProvider.php deleted file mode 100644 index 8d47a40..0000000 --- a/src/DataProvider/StringProvider.php +++ /dev/null @@ -1,181 +0,0 @@ - - */ - public static function arbitrary(): \Generator - { - yield from self::provideDataForValues(self::values()); - } - - /** - * @return \Generator - */ - public static function blank(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (string $value): bool { - return '' === \trim($value) - && '' !== $value; - }); - } - - /** - * @return \Generator - */ - public static function empty(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (string $value): bool { - return '' === $value; - }); - } - - /** - * @return \Generator - */ - public static function trimmed(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (string $value): bool { - return \trim($value) === $value - && '' !== \trim($value); - }); - } - - /** - * @return \Generator - */ - public static function untrimmed(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (string $value): bool { - return \trim($value) !== $value - && '' !== \trim($value); - }); - } - - /** - * @return \Generator - */ - public static function withWhitespace(): \Generator - { - yield from self::provideDataForValuesWhere(self::values(), static function (string $value): bool { - return \trim($value) === $value - && 1 === \preg_match('/\s/', $value); - }); - } - - /** - * @return array - */ - private static function values(): array - { - $faker = self::faker(); - - $arbitraryValues = [ - 'string-arbitrary-sentence' => $faker->sentence(), - 'string-arbitrary-word' => $faker->word(), - ]; - - $whitespaceCharacters = self::whitespaceCharacters(); - - /** @var array $blankValues */ - $blankValues = \array_combine( - \array_map(static function (string $key): string { - return \sprintf( - 'string-blank-%s', - $key, - ); - }, \array_keys($whitespaceCharacters)), - $whitespaceCharacters, - ); - - $emptyValues = [ - 'string-empty' => '', - ]; - - /** @var array $untrimmedValues */ - $untrimmedValues = \array_combine( - \array_map(static function (string $key): string { - return \sprintf( - 'string-untrimmed-%s', - $key, - ); - }, \array_keys($whitespaceCharacters)), - \array_map(static function (string $whitespaceCharacter) use ($faker): string { - return \sprintf( - '%s%s%s', - \str_repeat( - $whitespaceCharacter, - $faker->numberBetween(1, 5), - ), - $faker->word(), - \str_repeat( - $whitespaceCharacter, - $faker->numberBetween(1, 5), - ), - ); - }, $whitespaceCharacters), - ); - - /** @var array $withWhitespaceValues */ - $withWhitespaceValues = \array_combine( - \array_map(static function (string $key): string { - return \sprintf( - 'string-with-whitespace-%s', - $key, - ); - }, \array_keys($whitespaceCharacters)), - \array_map(static function (string $whitespaceCharacter) use ($faker): string { - /** @var array $words */ - $words = $faker->words($faker->numberBetween(2, 5)); - - return \implode( - $whitespaceCharacter, - $words, - ); - }, $whitespaceCharacters), - ); - - return \array_merge( - $arbitraryValues, - $blankValues, - $emptyValues, - $untrimmedValues, - $withWhitespaceValues, - ); - } - - /** - * @return array - */ - private static function whitespaceCharacters(): array - { - return [ - 'carriage-return' => "\r", - 'line-feed' => "\n", - 'space' => ' ', - 'tab' => "\t", - ]; - } -} diff --git a/test/Unit/DataProvider/AbstractProviderTestCase.php b/test/Unit/DataProvider/AbstractProviderTestCase.php deleted file mode 100644 index 019da3c..0000000 --- a/test/Unit/DataProvider/AbstractProviderTestCase.php +++ /dev/null @@ -1,116 +0,0 @@ - $values - * @param \Generator> $provider - */ - final protected static function assertProvidesDataSetsForValues(array $values, \Generator $provider): void - { - self::assertExpectedValuesAreNotEmpty($values); - - $expectedDataSets = \iterator_to_array(self::provideDataForValues($values)); - $actualDataSets = \iterator_to_array($provider); - - self::assertDataSetsAreNotEmpty($actualDataSets); - - self::assertEquals( - $expectedDataSets, - $actualDataSets, - 'Failed asserting that a generator yields data sets for the expected values.', - ); - } - - /** - * @param array $specifications - * @param \Generator> $provider - */ - final protected static function assertProvidesDataSetsForValuesSatisfyingSpecifications(array $specifications, \Generator $provider): void - { - self::assertContainsOnly( - 'string', - \array_keys($specifications), - true, - 'Failed asserting that the keys of specifications are all strings.', - ); - - self::assertContainsOnly( - Util\Test\Util\DataProvider\Specification\Specification::class, - $specifications, - false, - \sprintf( - 'Failed asserting that the values of specifications implement "%s".', - Util\Test\Util\DataProvider\Specification\Specification::class, - ), - ); - - $dataSets = \iterator_to_array($provider); - - self::assertEquals( - \array_keys($specifications), - \array_keys($dataSets), - 'Failed asserting that the provided data has the same keys as the specifications.', - ); - - $keysForDataSetsWhereValueDoesNotSatisfySpecification = \array_filter(\array_keys($dataSets), static function (string $key) use ($dataSets, $specifications): bool { - /** @var Util\Test\Util\DataProvider\Specification\Specification $specification */ - $specification = $specifications[$key]; - - $dataSet = $dataSets[$key]; - - self::assertIsArray($dataSet, \sprintf( - 'Failed asserting that the data set provided for key "%s" is an array.', - $key, - )); - - self::assertCount(1, $dataSet, \sprintf( - 'Failed asserting that the data set provided for key "%s" contains only one value.', - $key, - )); - - $value = \array_shift($dataSet); - - return !$specification->isSatisfiedBy($value); - }); - - self::assertEquals([], $keysForDataSetsWhereValueDoesNotSatisfySpecification, \sprintf( - 'Failed asserting that the value for the data sets with the keys "%s" satisfy the corresponding requirements.', - \implode( - '", "', - $keysForDataSetsWhereValueDoesNotSatisfySpecification, - ), - )); - } - - final protected static function assertDataSetsAreNotEmpty(array $actual): void - { - self::assertNotEmpty($actual, 'Failed asserting that provided data sets are not empty.'); - } - - private static function assertExpectedValuesAreNotEmpty(array $values): void - { - self::assertNotEmpty($values, 'Failed asserting that expected values are not empty.'); - } -} diff --git a/test/Unit/DataProvider/BoolProviderTest.php b/test/Unit/DataProvider/BoolProviderTest.php deleted file mode 100644 index 7bee8fe..0000000 --- a/test/Unit/DataProvider/BoolProviderTest.php +++ /dev/null @@ -1,89 +0,0 @@ - Util\DataProvider\Specification\Identical::create(false), - 'bool-true' => Util\DataProvider\Specification\Identical::create(true), - ]; - - $provider = BoolProvider::arbitrary(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\BoolProvider::false() - * - * @param mixed $value - */ - public function testFalseProvidesFalse($value): void - { - self::assertFalse($value); - } - - public function testFalseReturnsGeneratorThatProvidesFalse(): void - { - $specifications = [ - 'bool-false' => Util\DataProvider\Specification\Identical::create(false), - ]; - - $provider = BoolProvider::false(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\BoolProvider::true() - * - * @param mixed $value - */ - public function testTrueProvidesTrue($value): void - { - self::assertTrue($value); - } - - public function testTrueReturnsGeneratorThatProvidesTrue(): void - { - $specifications = [ - 'bool-true' => Util\DataProvider\Specification\Identical::create(true), - ]; - - $provider = BoolProvider::true(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/FloatProviderTest.php b/test/Unit/DataProvider/FloatProviderTest.php deleted file mode 100644 index 21af77f..0000000 --- a/test/Unit/DataProvider/FloatProviderTest.php +++ /dev/null @@ -1,172 +0,0 @@ - Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return -1.0 > $value; - }), - 'float-minus-one' => Util\DataProvider\Specification\Identical::create(-1.0), - 'float-zero' => Util\DataProvider\Specification\Identical::create(0.0), - 'float-plus-one' => Util\DataProvider\Specification\Identical::create(1.0), - 'float-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return 1.0 < $value; - }), - ]; - - $provider = FloatProvider::arbitrary(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\FloatProvider::lessThanZero() - */ - public function testLessThanZeroProvidesFloatLessThanZero(float $value): void - { - self::assertLessThan(0, $value); - } - - public function testLessThanZeroReturnsGeneratorThatProvidesFloatLessThanZero(): void - { - $specifications = [ - 'float-less-than-minus-one' => Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return -1.0 > $value; - }), - 'float-minus-one' => Util\DataProvider\Specification\Identical::create(-1.0), - ]; - - $provider = FloatProvider::lessThanZero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\FloatProvider::zero() - */ - public function testZeroProvidesZero(float $value): void - { - self::assertSame(0.0, $value); - } - - public function testZeroReturnsGeneratorThatProvidesZero(): void - { - $specifications = [ - 'float-zero' => Util\DataProvider\Specification\Identical::create(0.0), - ]; - - $provider = FloatProvider::zero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\FloatProvider::greaterThanZero() - */ - public function testGreaterThanZeroProvidesFloatGreaterThanZero(float $value): void - { - self::assertGreaterThan(0.0, $value); - } - - public function testGreaterThanZeroReturnsGeneratorThatProvidesFloatGreaterThanZero(): void - { - $specifications = [ - 'float-plus-one' => Util\DataProvider\Specification\Identical::create(1.0), - 'float-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return 1.0 < $value; - }), - ]; - - $provider = FloatProvider::greaterThanZero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\FloatProvider::lessThanOne() - */ - public function testLessThanOneProvidesFloatLessThanOne(float $value): void - { - self::assertLessThan(1, $value); - } - - public function testLessThanOneReturnsGeneratorThatProvidesFloatLessThanOne(): void - { - $specifications = [ - 'float-less-than-minus-one' => Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return -1.0 > $value; - }), - 'float-minus-one' => Util\DataProvider\Specification\Identical::create(-1.0), - 'float-zero' => Util\DataProvider\Specification\Identical::create(0.0), - ]; - - $provider = FloatProvider::lessThanOne(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - public function testOneReturnsGeneratorThatProvidesOne(): void - { - $specifications = [ - 'float-plus-one' => Util\DataProvider\Specification\Identical::create(1.0), - ]; - - $provider = FloatProvider::one(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\FloatProvider::greaterThanOne() - */ - public function testGreaterThanOneProvidesFloatGreaterThanOne(float $value): void - { - self::assertGreaterThan(1, $value); - } - - public function testGreaterThanOneReturnsGeneratorThatProvidesFloatGreaterThanOne(): void - { - $specifications = [ - 'float-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (float $value): bool { - return 1.0 < $value; - }), - ]; - - $provider = FloatProvider::greaterThanOne(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/IntProviderTest.php b/test/Unit/DataProvider/IntProviderTest.php deleted file mode 100644 index 59a0071..0000000 --- a/test/Unit/DataProvider/IntProviderTest.php +++ /dev/null @@ -1,172 +0,0 @@ - Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return -1 > $value; - }), - 'int-minus-one' => Util\DataProvider\Specification\Identical::create(-1), - 'int-zero' => Util\DataProvider\Specification\Identical::create(0), - 'int-plus-one' => Util\DataProvider\Specification\Identical::create(1), - 'int-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return 1 < $value; - }), - ]; - - $provider = IntProvider::arbitrary(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\IntProvider::lessThanZero() - */ - public function testLessThanZeroProvidesIntLessThanZero(int $value): void - { - self::assertLessThan(0, $value); - } - - public function testLessThanZeroReturnsGeneratorThatProvidesIntLessThanZero(): void - { - $specifications = [ - 'int-less-than-minus-one' => Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return -1 > $value; - }), - 'int-minus-one' => Util\DataProvider\Specification\Identical::create(-1), - ]; - - $provider = IntProvider::lessThanZero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\IntProvider::zero() - */ - public function testZeroProvidesZero(int $value): void - { - self::assertSame(0, $value); - } - - public function testZeroReturnsGeneratorThatProvidesZero(): void - { - $specifications = [ - 'int-zero' => Util\DataProvider\Specification\Identical::create(0), - ]; - - $provider = IntProvider::zero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\IntProvider::greaterThanZero() - */ - public function testGreaterThanZeroProvidesIntGreaterThanZero(int $value): void - { - self::assertGreaterThan(0, $value); - } - - public function testGreaterThanZeroReturnsGeneratorThatProvidesIntGreaterThanZero(): void - { - $specifications = [ - 'int-plus-one' => Util\DataProvider\Specification\Identical::create(1), - 'int-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return 1 < $value; - }), - ]; - - $provider = IntProvider::greaterThanZero(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\IntProvider::lessThanOne() - */ - public function testLessThanOneProvidesIntLessThanOne(int $value): void - { - self::assertLessThan(1, $value); - } - - public function testLessThanOneReturnsGeneratorThatProvidesIntLessThanOne(): void - { - $specifications = [ - 'int-less-than-minus-one' => Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return -1 > $value; - }), - 'int-minus-one' => Util\DataProvider\Specification\Identical::create(-1), - 'int-zero' => Util\DataProvider\Specification\Identical::create(0), - ]; - - $provider = IntProvider::lessThanOne(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - public function testOneReturnsGeneratorThatProvidesOne(): void - { - $specifications = [ - 'int-plus-one' => Util\DataProvider\Specification\Identical::create(1), - ]; - - $provider = IntProvider::one(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\IntProvider::greaterThanOne() - */ - public function testGreaterThanOneProvidesIntGreaterThanOne(int $value): void - { - self::assertGreaterThan(1, $value); - } - - public function testGreaterThanOneReturnsGeneratorThatProvidesIntGreaterThanOne(): void - { - $specifications = [ - 'int-greater-than-plus-one' => Util\DataProvider\Specification\Closure::create(static function (int $value): bool { - return 1 < $value; - }), - ]; - - $provider = IntProvider::greaterThanOne(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/NullProviderTest.php b/test/Unit/DataProvider/NullProviderTest.php deleted file mode 100644 index 97155e3..0000000 --- a/test/Unit/DataProvider/NullProviderTest.php +++ /dev/null @@ -1,46 +0,0 @@ - Util\DataProvider\Specification\Identical::create(null), - ]; - - $provider = NullProvider::null(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/ObjectProviderTest.php b/test/Unit/DataProvider/ObjectProviderTest.php deleted file mode 100644 index 4bea69d..0000000 --- a/test/Unit/DataProvider/ObjectProviderTest.php +++ /dev/null @@ -1,46 +0,0 @@ - Util\DataProvider\Specification\Equal::create(new \stdClass()), - ]; - - $provider = ObjectProvider::object(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/ResourceProviderTest.php b/test/Unit/DataProvider/ResourceProviderTest.php deleted file mode 100644 index b41cbcb..0000000 --- a/test/Unit/DataProvider/ResourceProviderTest.php +++ /dev/null @@ -1,48 +0,0 @@ - Util\DataProvider\Specification\Closure::create(static function ($value): bool { - return \is_resource($value); - }), - ]; - - $provider = ResourceProvider::resource(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Unit/DataProvider/StringProviderTest.php b/test/Unit/DataProvider/StringProviderTest.php deleted file mode 100644 index 5063122..0000000 --- a/test/Unit/DataProvider/StringProviderTest.php +++ /dev/null @@ -1,177 +0,0 @@ - Util\DataProvider\Specification\Closure::create(static function (string $value): bool { - return '' !== $value && '' !== \trim($value); - }), - 'string-arbitrary-word' => Util\DataProvider\Specification\Closure::create(static function (string $value): bool { - return '' !== $value && '' !== \trim($value); - }), - 'string-blank-carriage-return' => Util\DataProvider\Specification\Identical::create("\r"), - 'string-blank-line-feed' => Util\DataProvider\Specification\Identical::create("\n"), - 'string-blank-space' => Util\DataProvider\Specification\Identical::create(' '), - 'string-blank-tab' => Util\DataProvider\Specification\Identical::create("\t"), - 'string-empty' => Util\DataProvider\Specification\Identical::create(''), - 'string-untrimmed-carriage-return' => Util\DataProvider\Specification\Pattern::create('/^\r{1,5}\w+\r{1,5}$/'), - 'string-untrimmed-line-feed' => Util\DataProvider\Specification\Pattern::create('/^\n{1,5}\w+\n{1,5}$/'), - 'string-untrimmed-space' => Util\DataProvider\Specification\Pattern::create('/^\s{1,5}\w+\s{1,5}$/'), - 'string-untrimmed-tab' => Util\DataProvider\Specification\Pattern::create('/^\t{1,5}\w+\t{1,5}$/'), - 'string-with-whitespace-carriage-return' => Util\DataProvider\Specification\Pattern::create('/^\w+(\r+\w+){1,4}$/'), - 'string-with-whitespace-line-feed' => Util\DataProvider\Specification\Pattern::create('/^\w+(\n+\w+){1,4}$/'), - 'string-with-whitespace-space' => Util\DataProvider\Specification\Pattern::create('/^\w+(\s+\w+){1,4}$/'), - 'string-with-whitespace-tab' => Util\DataProvider\Specification\Pattern::create('/^\w+(\t+\w+){1,4}$/'), - ]; - - $provider = StringProvider::arbitrary(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\StringProvider::blank() - */ - public function testBlankProvidesBlankString(string $value): void - { - self::assertSame('', \trim($value)); - self::assertNotSame('', $value); - } - - public function testBlankReturnsGeneratorThatProvidesStringsThatAreNeitherEmptyNorBlank(): void - { - $specifications = [ - 'string-blank-carriage-return' => Util\DataProvider\Specification\Identical::create("\r"), - 'string-blank-line-feed' => Util\DataProvider\Specification\Identical::create("\n"), - 'string-blank-space' => Util\DataProvider\Specification\Identical::create(' '), - 'string-blank-tab' => Util\DataProvider\Specification\Identical::create("\t"), - ]; - - $provider = StringProvider::blank(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\StringProvider::empty() - */ - public function testEmptyProvidesEmptyString(string $value): void - { - self::assertSame('', $value); - } - - public function testEmptyReturnsGeneratorThatProvidesAnEmptyString(): void - { - $specifications = [ - 'string-empty' => Util\DataProvider\Specification\Identical::create(''), - ]; - - $provider = StringProvider::empty(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\StringProvider::untrimmed() - */ - public function testUntrimmedProvidesUntrimmedString(string $value): void - { - self::assertNotSame(\trim($value), $value); - self::assertNotSame('', $value); - self::assertNotSame('', \trim($value)); - } - - /** - * @dataProvider \Ergebnis\Test\Util\DataProvider\StringProvider::trimmed() - * - * @param mixed $value - */ - public function testTrimmedProvidesString($value): void - { - self::assertIsString($value); - } - - public function testTrimmedReturnsGeneratorThatProvidesStringsThatAreTrimmed(): void - { - $specifications = [ - 'string-arbitrary-sentence' => Util\DataProvider\Specification\Closure::create(static function (string $value): bool { - return '' !== $value && '' !== \trim($value); - }), - 'string-arbitrary-word' => Util\DataProvider\Specification\Closure::create(static function (string $value): bool { - return '' !== $value && '' !== \trim($value); - }), - 'string-with-whitespace-carriage-return' => Util\DataProvider\Specification\Pattern::create('/^\w+(\r+\w+){1,4}$/'), - 'string-with-whitespace-line-feed' => Util\DataProvider\Specification\Pattern::create('/^\w+(\n+\w+){1,4}$/'), - 'string-with-whitespace-space' => Util\DataProvider\Specification\Pattern::create('/^\w+(\s+\w+){1,4}$/'), - 'string-with-whitespace-tab' => Util\DataProvider\Specification\Pattern::create('/^\w+(\t+\w+){1,4}$/'), - ]; - - $provider = StringProvider::trimmed(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - public function testUntrimmedReturnsGeneratorThatProvidesUntrimmedStrings(): void - { - $specifications = [ - 'string-untrimmed-carriage-return' => Util\DataProvider\Specification\Pattern::create('/^\r{1,5}\w+\r{1,5}$/'), - 'string-untrimmed-line-feed' => Util\DataProvider\Specification\Pattern::create('/^\n{1,5}\w+\n{1,5}$/'), - 'string-untrimmed-space' => Util\DataProvider\Specification\Pattern::create('/^\s{1,5}\w+\s{1,5}$/'), - 'string-untrimmed-tab' => Util\DataProvider\Specification\Pattern::create('/^\t{1,5}\w+\t{1,5}$/'), - ]; - - $provider = StringProvider::untrimmed(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } - - public function testWithWhitespaceReturnsGeneratorThatProvidesTrimmedStringsWithWhitespace(): void - { - $specifications = [ - 'string-arbitrary-sentence' => Util\DataProvider\Specification\Closure::create(static function (string $value): bool { - return '' !== $value && '' !== \trim($value); - }), - 'string-with-whitespace-carriage-return' => Util\DataProvider\Specification\Pattern::create('/^\w+(\r+\w+){1,4}$/'), - 'string-with-whitespace-line-feed' => Util\DataProvider\Specification\Pattern::create('/^\w+(\n+\w+){1,4}$/'), - 'string-with-whitespace-space' => Util\DataProvider\Specification\Pattern::create('/^\w+(\s+\w+){1,4}$/'), - 'string-with-whitespace-tab' => Util\DataProvider\Specification\Pattern::create('/^\w+(\t+\w+){1,4}$/'), - ]; - - $provider = StringProvider::withWhitespace(); - - self::assertProvidesDataSetsForValuesSatisfyingSpecifications($specifications, $provider); - } -} diff --git a/test/Util/DataProvider/Specification/Closure.php b/test/Util/DataProvider/Specification/Closure.php deleted file mode 100644 index 249b7f0..0000000 --- a/test/Util/DataProvider/Specification/Closure.php +++ /dev/null @@ -1,38 +0,0 @@ -closure = static function ($value) use ($closure): bool { - return true === $closure($value); - }; - } - - public static function create(\Closure $closure): self - { - return new self($closure); - } - - public function isSatisfiedBy($value): bool - { - $closure = $this->closure; - - return $closure($value); - } -} diff --git a/test/Util/DataProvider/Specification/Equal.php b/test/Util/DataProvider/Specification/Equal.php deleted file mode 100644 index a11a72f..0000000 --- a/test/Util/DataProvider/Specification/Equal.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $value; - } - - public static function create($value): self - { - return new self($value); - } - - public function isSatisfiedBy($value): bool - { - return $this->value == $value; - } -} diff --git a/test/Util/DataProvider/Specification/Identical.php b/test/Util/DataProvider/Specification/Identical.php deleted file mode 100644 index e7c5509..0000000 --- a/test/Util/DataProvider/Specification/Identical.php +++ /dev/null @@ -1,34 +0,0 @@ -value = $value; - } - - public static function create($value): self - { - return new self($value); - } - - public function isSatisfiedBy($value): bool - { - return $this->value === $value; - } -} diff --git a/test/Util/DataProvider/Specification/Pattern.php b/test/Util/DataProvider/Specification/Pattern.php deleted file mode 100644 index 97fffb0..0000000 --- a/test/Util/DataProvider/Specification/Pattern.php +++ /dev/null @@ -1,38 +0,0 @@ -pattern = $pattern; - } - - public static function create(string $pattern): self - { - return new self($pattern); - } - - public function isSatisfiedBy($value): bool - { - if (!\is_string($value)) { - return false; - } - - return 1 === \preg_match($this->pattern, $value); - } -} diff --git a/test/Util/DataProvider/Specification/Specification.php b/test/Util/DataProvider/Specification/Specification.php deleted file mode 100644 index 5297ca1..0000000 --- a/test/Util/DataProvider/Specification/Specification.php +++ /dev/null @@ -1,19 +0,0 @@ -