mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66f69617f1 | |||
| 5721e8c29a | |||
| 546d19fd84 | |||
| c1b32b9ffb | |||
| 298b1e6784 | |||
| 63f009fadf | |||
| 1066c2270d | |||
| 984f237a92 | |||
| dccd8239dd | |||
| e103623ecb | |||
| 542fc046d2 | |||
| 4720e0655b | |||
| a533772fe2 | |||
| 2218a0c137 | |||
| 2831629f1b | |||
| 1b7f1dc5b3 | |||
| 92b8d32ef7 | |||
| 2969c7a5e3 | |||
| 63c1faa9f4 | |||
| b5b14ef280 | |||
| 11eb1903c2 | |||
| a110848f9b | |||
| da5c21de8f | |||
| 408ae4cad8 | |||
| fc2484a28a | |||
| de46ee0f64 | |||
| 1e011c7b40 | |||
| 04dcebf3aa | |||
| e853792a59 | |||
| b0fbe54181 | |||
| 2a649bdfc0 | |||
| e042bf7d3a | |||
| 3ff71a4563 | |||
| 205238fcbf | |||
| ba06c5a76d | |||
| 78ffc491e9 | |||
| 7f38de11b7 | |||
| a6e34d204c | |||
| 66d47e4922 | |||
| 7d70b6e95a | |||
| 076dcab4c5 | |||
| 6f42e336c9 | |||
| 0d72b5197c | |||
| 7691e3c602 | |||
| b43a59868d | |||
| 457972716f | |||
| ae029660e3 | |||
| dc12419078 | |||
| f0ddd10a54 | |||
| 4daf7ee4ab | |||
| d60f320382 | |||
| 3c3e6b160b | |||
| c99f8f196e | |||
| 9cc4ecd5ab | |||
| 8d96f975e0 | |||
| 7f214f9e12 | |||
| da258fa89f | |||
| f23f857903 | |||
| fec11928cf | |||
| f6131d042b | |||
| 543b9542ae | |||
| 1681c1f4f8 | |||
| f41c3ce9ba | |||
| 847b06e558 | |||
| 601c4b01fc | |||
| 05c1c82ae2 | |||
| 1bde49b3c4 | |||
| b22f5e0c85 | |||
| dd643faa5c | |||
| facbf05016 | |||
| 0b19672963 | |||
| a16a19e121 | |||
| 3dd10b3c7c | |||
| 12e63c7376 | |||
| 1d4c1a5359 | |||
| 8e32b88fc8 | |||
| 1a7baad338 |
4
.github/workflows/changelog.yml
vendored
4
.github/workflows/changelog.yml
vendored
@ -2,12 +2,12 @@ name: Changelog
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ 1.x ]
|
||||
paths:
|
||||
- CHANGELOG.md
|
||||
- .github/workflows/changelog.yml
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
branches: [ 1.x ]
|
||||
paths:
|
||||
- CHANGELOG.md
|
||||
jobs:
|
||||
|
||||
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
@ -11,6 +11,11 @@ jobs:
|
||||
php: ['7.3', '7.4', '8.0', '8.1']
|
||||
dependency-version: [prefer-lowest, prefer-stable]
|
||||
parallel: ['', '--parallel']
|
||||
exclude:
|
||||
- php: 8.1
|
||||
os: macos-latest
|
||||
- php: 8.1
|
||||
os: windows-latest
|
||||
|
||||
name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} - ${{ matrix.parallel }}
|
||||
|
||||
|
||||
28
CHANGELOG.md
28
CHANGELOG.md
@ -4,9 +4,37 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [v1.21.3 (2022-05-12)](https://github.com/pestphp/pest/compare/v1.21.2...v1.21.3)
|
||||
### Fixed
|
||||
- Debug of high order tests ([c1b32b9](https://github.com/pestphp/pest/commit/c1b32b9ffb5134803c490592454b11b8c05ea27d))
|
||||
|
||||
## [v1.21.2 (2022-03-05)](https://github.com/pestphp/pest/compare/v1.21.1...v1.21.2)
|
||||
### Fixed
|
||||
- `toThrow` expectation when exception does not exist ([#487](https://github.com/pestphp/pest/pull/487))
|
||||
|
||||
## [v1.21.1 (2021-11-25)](https://github.com/pestphp/pest/compare/v1.21.0...v1.21.1)
|
||||
### Fixed
|
||||
- sequence callables causing problems ([#442](https://github.com/pestphp/pest/pull/442))
|
||||
|
||||
## [v1.21.0 (2021-11-17)](https://github.com/pestphp/pest/compare/v1.20.0...v1.21.0)
|
||||
### Added
|
||||
- warn about xdebug modes ([1e011c](https://github.com/pestphp/pest/commit/1e011c7b4074d08f5dabab1f927d45383c85d210))
|
||||
|
||||
## [v1.20.0 (2021-09-25)](https://github.com/pestphp/pest/compare/v1.19.0...v1.20.0)
|
||||
### Added
|
||||
- `throwsIf` test call ([#371](https://github.com/pestphp/pest/pull/371))
|
||||
- `--ci` CLI option to ignore development options like `->local()` ([#405](https://github.com/pestphp/pest/pull/405))
|
||||
- `when` conditional expectation ([#406](https://github.com/pestphp/pest/pull/406))
|
||||
- `unless` conditional expectation ([b43a598](https://github.com/pestphp/pest/commit/b43a59868d5b790a28cbb29c6110c9f068b0b812))
|
||||
- `match` conditional expectation ([#407](https://github.com/pestphp/pest/pull/407))
|
||||
|
||||
### Fixed
|
||||
- `sequence` with more expectations than iterable elements ([#399](https://github.com/pestphp/pest/pull/399))
|
||||
|
||||
## [v1.19.0 (2021-09-20)](https://github.com/pestphp/pest/compare/v1.18.0...v1.19.0)
|
||||
### Added
|
||||
- PHP 8.1 support ([e6c7d68](https://github.com/pestphp/pest/commit/e6c7d68defaec8efe01e71e15dd8d8c45b0cf60f))
|
||||
- `toHaveProperties` expectation ([#391](https://github.com/pestphp/pest/pull/391))
|
||||
|
||||
## [v1.18.0 (2021-08-30)](https://github.com/pestphp/pest/compare/v1.17.0...v1.18.0)
|
||||
### Added
|
||||
|
||||
18
README.md
18
README.md
@ -19,14 +19,18 @@
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Pest development. If you are interested in becoming a sponsor, please visit the Nuno Maduro's [Sponsors page](https://github.com/sponsors/nunomaduro).
|
||||
|
||||
### Platinum Sponsors
|
||||
|
||||
- **[Spatie](https://spatie.be)**
|
||||
- **[Worksome](https://www.worksome.com/)**
|
||||
|
||||
### Premium Sponsors
|
||||
|
||||
- **[Akaunting](https://akaunting.com)**
|
||||
- **[Auth0](https://auth0.com)**
|
||||
- **[Codecourse](https://codecourse.com/)**
|
||||
- **[Fathom Analytics](https://usefathom.com/)**
|
||||
- **[Meema](https://meema.io)**
|
||||
- **[Scout APM](https://scoutapm.com)**
|
||||
- **[Spatie](https://spatie.be)**
|
||||
- [Akaunting](https://akaunting.com)
|
||||
- [Auth0](https://auth0.com)
|
||||
- [Codecourse](https://codecourse.com/)
|
||||
- [Fathom Analytics](https://usefathom.com/)
|
||||
- [Meema](https://meema.io)
|
||||
- [Scout APM](https://scoutapm.com)
|
||||
|
||||
Pest is an open-sourced software licensed under the **[MIT license](https://opensource.org/licenses/MIT)**.
|
||||
|
||||
@ -2,14 +2,15 @@
|
||||
|
||||
When releasing a new version of Pest there are some checks and updates that need to be done:
|
||||
|
||||
- Clear your local repository with: `git add . && git reset --hard && git checkout master`
|
||||
- On the GitHub repository, check the contents of [github.com/pestphp/pest/compare/{latest_version}...master](https://github.com/pestphp/pest/compare/{latest_version}...master) and update the [changelog](CHANGELOG.md) file with the main changes for this release
|
||||
- Clear your local repository with: `git add . && git reset --hard && git checkout 1.x`
|
||||
- On the GitHub repository, check the contents of [github.com/pestphp/pest/compare/{latest_version}...1.x](https://github.com/pestphp/pest/compare/{latest_version}...1.x) and update the [changelog](CHANGELOG.md) file with the main changes for this release
|
||||
- Update the version number in [src/Pest.php](src/Pest.php)
|
||||
- Run the tests locally using: `composer test`
|
||||
- Commit the CHANGELOG and Pest file with the message: `git commit -m "release: vX.X.X"`
|
||||
- Push the changes to GitHub
|
||||
- Check that the CI is passing as expected: [github.com/pestphp/pest/actions](https://github.com/pestphp/pest/actions)
|
||||
- Tag and push the tag with `git tag vX.X.X && git push --tags`
|
||||
- Publish release here: [github.com/pestphp/pest/releases/new](https://github.com/pestphp/pest/releases/new).
|
||||
|
||||
### Plugins
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.3 || ^8.0",
|
||||
"nunomaduro/collision": "^5.4.0|^6.0",
|
||||
"nunomaduro/collision": "^5.10.0|^6.0",
|
||||
"pestphp/pest-plugin": "^1.0.0",
|
||||
"phpunit/phpunit": "^9.5.5"
|
||||
},
|
||||
@ -50,7 +50,10 @@
|
||||
"prefer-stable": true,
|
||||
"config": {
|
||||
"sort-packages": true,
|
||||
"preferred-install": "dist"
|
||||
"preferred-install": "dist",
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true
|
||||
}
|
||||
},
|
||||
"bin": [
|
||||
"bin/pest"
|
||||
@ -73,13 +76,14 @@
|
||||
},
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.x-dev"
|
||||
"dev-1.x": "1.x-dev"
|
||||
},
|
||||
"pest": {
|
||||
"plugins": [
|
||||
"Pest\\Plugins\\Coverage",
|
||||
"Pest\\Plugins\\Init",
|
||||
"Pest\\Plugins\\Version"
|
||||
"Pest\\Plugins\\Version",
|
||||
"Pest\\Plugins\\Environment"
|
||||
]
|
||||
},
|
||||
"laravel": {
|
||||
|
||||
287
phpstan-baseline.neon
Normal file
287
phpstan-baseline.neon
Normal file
@ -0,0 +1,287 @@
|
||||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Cannot access an offset on mixed\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$out of class Pest\\\\Logging\\\\JUnit constructor expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$verbose of class NunoMaduro\\\\Collision\\\\Adapters\\\\Phpunit\\\\Printer constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$verbose of class Pest\\\\Logging\\\\TeamCity constructor expects bool, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$colors of class NunoMaduro\\\\Collision\\\\Adapters\\\\Phpunit\\\\Printer constructor expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#3 \\$colors of class Pest\\\\Logging\\\\TeamCity constructor expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/AddsDefaults.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$filename of function file_exists expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/ValidatesConfiguration.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$filename of method PHPUnit\\\\TextUI\\\\XmlConfiguration\\\\Loader\\:\\:load\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Actions/ValidatesConfiguration.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$loader of class PHPUnit\\\\TextUI\\\\TestRunner constructor expects PHPUnit\\\\Runner\\\\TestSuiteLoader\\|null, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Console/Command.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$testSuite of static method Pest\\\\Actions\\\\AddsTests\\:\\:to\\(\\) expects iterable\\<PHPUnit\\\\Framework\\\\TestCase\\>&PHPUnit\\\\Framework\\\\TestSuite, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Console/Command.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$suffixes of method SebastianBergmann\\\\FileIterator\\\\Facade\\:\\:getFilesAsArray\\(\\) expects array\\|string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Console/Command.php
|
||||
|
||||
-
|
||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||
count: 1
|
||||
path: src/Datasets.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Datasets\\:\\:getDataSetsCombinations\\(\\) has parameter \\$combinations with no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: src/Datasets.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Datasets\\:\\:getDataSetsCombinations\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: src/Datasets.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Datasets\\:\\:processDatasets\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
path: src/Datasets.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$key of static method Pest\\\\Datasets\\:\\:getDataSetDescription\\(\\) expects int\\|string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Datasets.php
|
||||
|
||||
-
|
||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||
count: 1
|
||||
path: src/Each.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$ of callable callable\\(Pest\\\\Expectation\\<TValue\\>\\)\\: mixed expects Pest\\\\Expectation\\<TValue\\>, Pest\\\\Expectation\\<mixed\\> given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$actualJson of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertJson\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$directory of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertDirectoryExists\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$directory of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertDirectoryIsReadable\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$directory of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertDirectoryIsWritable\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$file of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFileIsReadable\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$file of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFileIsWritable\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$filename of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertFileExists\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$json of function json_decode expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$needle of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringContainsString\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$object_or_class of function property_exists expects object\\|string, mixed given\\.$#"
|
||||
count: 2
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertContains\\(\\) expects iterable, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$haystack of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertCount\\(\\) expects Countable\\|iterable, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$string of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertMatchesRegularExpression\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$string of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringEndsWith\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$string of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertStringStartsWith\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$value of method Pest\\\\Expectation\\<TValue\\>\\:\\:retrieve\\(\\) expects array\\<string, null\\>\\|object, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Trying to invoke mixed but it's not a callable\\.$#"
|
||||
count: 1
|
||||
path: src/Expectation.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Factories\\\\TestCaseFactory\\:\\:build\\(\\) should return array\\<int, PHPUnit\\\\Framework\\\\TestCase\\> but returns array\\<int, object\\>\\.$#"
|
||||
count: 1
|
||||
path: src/Factories/TestCaseFactory.php
|
||||
|
||||
-
|
||||
message: "#^Function it\\(\\) should return Pest\\\\PendingObjects\\\\TestCall but returns mixed\\.$#"
|
||||
count: 1
|
||||
path: src/Functions.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$classAndTraits of class Pest\\\\PendingObjects\\\\UsesCall constructor expects array\\<int, string\\>, array\\<int\\|string, string\\> given\\.$#"
|
||||
count: 1
|
||||
path: src/Functions.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$value of method Pest\\\\HigherOrderExpectation\\:\\:retrieve\\(\\) expects array\\<string, null\\>\\|object, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/HigherOrderExpectation.php
|
||||
|
||||
-
|
||||
message: "#^Dead catch \\- ReflectionException is never thrown in the try block\\.$#"
|
||||
count: 1
|
||||
path: src/Logging/JUnit.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$value of method DOMElement\\:\\:setAttribute\\(\\) expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Logging/JUnit.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$test of method Pest\\\\Logging\\\\JUnit\\:\\:startTest\\(\\) has invalid type Pest\\\\Concerns\\\\Testable\\.$#"
|
||||
count: 1
|
||||
path: src/Logging/JUnit.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$test of method Pest\\\\Logging\\\\TeamCity\\:\\:endTest\\(\\) has invalid type Pest\\\\Concerns\\\\Testable\\.$#"
|
||||
count: 1
|
||||
path: src/Logging/TeamCity.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\$test of method Pest\\\\Logging\\\\TeamCity\\:\\:startTest\\(\\) has invalid type Pest\\\\Concerns\\\\Testable\\.$#"
|
||||
count: 1
|
||||
path: src/Logging/TeamCity.php
|
||||
|
||||
-
|
||||
message: "#^Dead catch \\- PHPUnit\\\\Framework\\\\ExpectationFailedException is never thrown in the try block\\.$#"
|
||||
count: 1
|
||||
path: src/OppositeExpectation.php
|
||||
|
||||
-
|
||||
message: "#^Property Pest\\\\PendingObjects\\\\UsesCall\\:\\:\\$groups \\(array\\<int, string\\>\\) does not accept array\\<int\\|string, string\\>\\.$#"
|
||||
count: 1
|
||||
path: src/PendingObjects/UsesCall.php
|
||||
|
||||
-
|
||||
message: "#^Cannot cast mixed to float\\.$#"
|
||||
count: 1
|
||||
path: src/Plugins/Coverage.php
|
||||
|
||||
-
|
||||
message: "#^Static property Pest\\\\Plugins\\\\Environment\\:\\:\\$instance is unused\\.$#"
|
||||
count: 1
|
||||
path: src/Plugins/Environment.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Support\\\\Container\\:\\:get\\(\\) should return object but returns mixed\\.$#"
|
||||
count: 1
|
||||
path: src/Support/Container.php
|
||||
|
||||
-
|
||||
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
|
||||
count: 1
|
||||
path: src/Support/ExceptionTrace.php
|
||||
|
||||
-
|
||||
message: "#^Cannot access offset 'file' on mixed\\.$#"
|
||||
count: 1
|
||||
path: src/Support/ExceptionTrace.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$haystack of function mb_strpos expects string, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Support/ExceptionTrace.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#2 \\$array of function key_exists expects array, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Support/ExceptionTrace.php
|
||||
|
||||
-
|
||||
message: "#^Method Pest\\\\Support\\\\HigherOrderCallables\\:\\:expect\\(\\) should return Pest\\\\Expectation\\<TValue\\> but returns Pest\\\\Expectation\\<mixed\\>\\.$#"
|
||||
count: 1
|
||||
path: src/Support/HigherOrderCallables.php
|
||||
|
||||
-
|
||||
message: "#^Parameter \\#1 \\$target of method Pest\\\\Support\\\\HigherOrderMessage\\:\\:call\\(\\) expects object, mixed given\\.$#"
|
||||
count: 1
|
||||
path: src/Support/HigherOrderMessageCollection.php
|
||||
|
||||
-
|
||||
message: "#^Constant Pest\\\\Support\\\\HigherOrderTapProxy\\:\\:UNDEFINED_PROPERTY is unused\\.$#"
|
||||
count: 1
|
||||
path: src/Support/HigherOrderTapProxy.php
|
||||
|
||||
-
|
||||
message: "#^Dead catch \\- Throwable is never thrown in the try block\\.$#"
|
||||
count: 1
|
||||
path: src/Support/HigherOrderTapProxy.php
|
||||
|
||||
@ -2,6 +2,7 @@ includes:
|
||||
- vendor/phpstan/phpstan-strict-rules/rules.neon
|
||||
- vendor/ergebnis/phpstan-rules/rules.neon
|
||||
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
|
||||
- phpstan-baseline.neon
|
||||
|
||||
parameters:
|
||||
level: max
|
||||
@ -23,9 +24,6 @@ parameters:
|
||||
-
|
||||
message: '#Call to an undefined method PHPUnit\\Framework\\Test::getName\(\)#'
|
||||
path: src/Logging
|
||||
-
|
||||
message: '#invalid typehint type Pest\\Concerns\\Testable#'
|
||||
path: src/Logging
|
||||
-
|
||||
message: '#is not subtype of native type PHPUnit\\Framework\\Test#'
|
||||
path: src/Logging
|
||||
|
||||
@ -50,6 +50,7 @@ final class LoadStructure
|
||||
$directory = new RecursiveDirectoryIterator($filename);
|
||||
$iterator = new RecursiveIteratorIterator($directory);
|
||||
foreach ($iterator as $file) {
|
||||
/* @phpstan-ignore-next-line */
|
||||
$filename = $file->__toString();
|
||||
if (Str::endsWith($filename, '.php') && file_exists($filename)) {
|
||||
require_once $filename;
|
||||
|
||||
@ -12,9 +12,6 @@ interface HandlesArguments
|
||||
/**
|
||||
* Allows to handle custom command line arguments.
|
||||
*
|
||||
* PLEASE NOTE: it is necessary to remove any custom argument from the array
|
||||
* because otherwise the application will complain about them
|
||||
*
|
||||
* @param array<int, string> $arguments
|
||||
*
|
||||
* @return array<int, string> the updated list of arguments
|
||||
|
||||
@ -6,6 +6,7 @@ namespace Pest;
|
||||
|
||||
use BadMethodCallException;
|
||||
use Closure;
|
||||
use Error;
|
||||
use InvalidArgumentException;
|
||||
use Pest\Concerns\Extendable;
|
||||
use Pest\Concerns\RetrievesValues;
|
||||
@ -108,7 +109,6 @@ final class Expectation
|
||||
public function ray(...$arguments): self
|
||||
{
|
||||
if (function_exists('ray')) {
|
||||
// @phpstan-ignore-next-line
|
||||
ray($this->value, ...$arguments);
|
||||
}
|
||||
|
||||
@ -154,9 +154,10 @@ final class Expectation
|
||||
throw new BadMethodCallException('Expectation value is not iterable.');
|
||||
}
|
||||
|
||||
$value = is_array($this->value) ? $this->value : iterator_to_array($this->value);
|
||||
$keys = array_keys($value);
|
||||
$values = array_values($value);
|
||||
$value = is_array($this->value) ? $this->value : iterator_to_array($this->value);
|
||||
$keys = array_keys($value);
|
||||
$values = array_values($value);
|
||||
$callbacksCount = count($callbacks);
|
||||
|
||||
$index = 0;
|
||||
|
||||
@ -165,8 +166,12 @@ final class Expectation
|
||||
$index = $index < count($values) - 1 ? $index + 1 : 0;
|
||||
}
|
||||
|
||||
if ($callbacksCount > count($values)) {
|
||||
Assert::assertLessThanOrEqual(count($value), count($callbacks));
|
||||
}
|
||||
|
||||
foreach ($values as $key => $item) {
|
||||
if (is_callable($callbacks[$key])) {
|
||||
if ($callbacks[$key] instanceof Closure) {
|
||||
call_user_func($callbacks[$key], new self($item), new self($keys[$key]));
|
||||
continue;
|
||||
}
|
||||
@ -177,6 +182,88 @@ final class Expectation
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the subject matches one of the given "expressions", the expression callback will run.
|
||||
*
|
||||
* @template TMatchSubject of array-key
|
||||
*
|
||||
* @param callable(): TMatchSubject|TMatchSubject $subject
|
||||
* @param array<TMatchSubject, (callable(Expectation<TValue>): mixed)|TValue> $expressions
|
||||
*/
|
||||
public function match($subject, array $expressions): Expectation
|
||||
{
|
||||
$subject = is_callable($subject)
|
||||
? $subject
|
||||
: function () use ($subject) {
|
||||
return $subject;
|
||||
};
|
||||
|
||||
$subject = $subject();
|
||||
|
||||
$matched = false;
|
||||
|
||||
foreach ($expressions as $key => $callback) {
|
||||
if ($subject != $key) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$matched = true;
|
||||
|
||||
if (is_callable($callback)) {
|
||||
$callback(new self($this->value));
|
||||
continue;
|
||||
}
|
||||
|
||||
$this->and($this->value)->toEqual($callback);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ($matched === false) {
|
||||
throw new ExpectationFailedException('Unhandled match value.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the callback if the given "condition" is falsy.
|
||||
*
|
||||
* @param (callable(): bool)|bool $condition
|
||||
* @param callable(Expectation<TValue>): mixed $callback
|
||||
*/
|
||||
public function unless($condition, callable $callback): Expectation
|
||||
{
|
||||
$condition = is_callable($condition)
|
||||
? $condition
|
||||
: static function () use ($condition): bool {
|
||||
return (bool) $condition; // @phpstan-ignore-line
|
||||
};
|
||||
|
||||
return $this->when(!$condition(), $callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply the callback if the given "condition" is truthy.
|
||||
*
|
||||
* @param (callable(): bool)|bool $condition
|
||||
* @param callable(Expectation<TValue>): mixed $callback
|
||||
*/
|
||||
public function when($condition, callable $callback): Expectation
|
||||
{
|
||||
$condition = is_callable($condition)
|
||||
? $condition
|
||||
: static function () use ($condition): bool {
|
||||
return (bool) $condition; // @phpstan-ignore-line
|
||||
};
|
||||
|
||||
if ($condition()) {
|
||||
$callback($this->and($this->value));
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that two variables have the same type and
|
||||
* value. Used on objects, it asserts that two
|
||||
@ -636,7 +723,7 @@ final class Expectation
|
||||
try {
|
||||
Assert::assertTrue(Arr::has($array, $key));
|
||||
|
||||
/* @phpstan-ignore-next-line */
|
||||
/* @phpstan-ignore-next-line */
|
||||
} catch (ExpectationFailedException $exception) {
|
||||
throw new ExpectationFailedException("Failed asserting that an array has the key '$key'", $exception->getComparisonFailure());
|
||||
}
|
||||
@ -825,8 +912,12 @@ final class Expectation
|
||||
|
||||
try {
|
||||
($this->value)();
|
||||
} catch (Throwable $e) { // @phpstan-ignore-line
|
||||
} catch (Throwable $e) {
|
||||
if (!class_exists($exception)) {
|
||||
if ($e instanceof Error && (bool) preg_match("/Class [\"']{$exception}[\"'] not found/", $e->getMessage())) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
Assert::assertStringContainsString($exception, $e->getMessage());
|
||||
|
||||
return $this;
|
||||
|
||||
@ -173,7 +173,6 @@ final class JUnit extends Printer implements TestListener
|
||||
$this->doAddSkipped();
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function startTestSuite(TestSuite $suite): void
|
||||
{
|
||||
$testSuite = $this->document->createElement('testsuite');
|
||||
@ -212,7 +211,6 @@ final class JUnit extends Printer implements TestListener
|
||||
$this->testSuiteTimes[$this->testSuiteLevel] = 0;
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function endTestSuite(TestSuite $suite): void
|
||||
{
|
||||
$this->testSuites[$this->testSuiteLevel]->setAttribute(
|
||||
@ -283,7 +281,6 @@ final class JUnit extends Printer implements TestListener
|
||||
$class = new ReflectionClass($test);
|
||||
// @codeCoverageIgnoreStart
|
||||
} catch (ReflectionException $e) {
|
||||
// @phpstan-ignore-next-line
|
||||
throw new Exception($e->getMessage(), (int) $e->getCode(), $e);
|
||||
}
|
||||
// @codeCoverageIgnoreEnd
|
||||
|
||||
@ -106,7 +106,6 @@ final class TeamCity extends DefaultResultPrinter
|
||||
- $result->riskyCount();
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function startTestSuite(TestSuite $suite): void
|
||||
{
|
||||
$suiteName = $suite->getName();
|
||||
@ -164,7 +163,6 @@ final class TeamCity extends DefaultResultPrinter
|
||||
);
|
||||
}
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
public function endTestSuite(TestSuite $suite): void
|
||||
{
|
||||
$suiteName = $suite->getName();
|
||||
|
||||
@ -51,6 +51,8 @@ final class OppositeExpectation
|
||||
* Handle dynamic method calls into the original expectation.
|
||||
*
|
||||
* @param array<int, mixed> $arguments
|
||||
*
|
||||
* @return Expectation|never
|
||||
*/
|
||||
public function __call(string $name, array $arguments): Expectation
|
||||
{
|
||||
@ -61,12 +63,13 @@ final class OppositeExpectation
|
||||
return $this->original;
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
$this->throwExpectationFailedException($name, $arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle dynamic properties gets into the original expectation.
|
||||
*
|
||||
* @return Expectation|never
|
||||
*/
|
||||
public function __get(string $name): Expectation
|
||||
{
|
||||
@ -77,7 +80,6 @@ final class OppositeExpectation
|
||||
return $this->original;
|
||||
}
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
$this->throwExpectationFailedException($name);
|
||||
}
|
||||
|
||||
@ -85,6 +87,8 @@ final class OppositeExpectation
|
||||
* Creates a new expectation failed exception with a nice readable message.
|
||||
*
|
||||
* @param array<int, mixed> $arguments
|
||||
*
|
||||
* @return never
|
||||
*/
|
||||
private function throwExpectationFailedException(string $name, array $arguments = []): void
|
||||
{
|
||||
|
||||
@ -78,6 +78,26 @@ final class TestCall
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that the test throws the given `$exceptionClass` when called if the given condition is true.
|
||||
*
|
||||
* @param (callable(): bool)|bool $condition
|
||||
*/
|
||||
public function throwsIf($condition, string $exception, string $exceptionMessage = null): TestCall
|
||||
{
|
||||
$condition = is_callable($condition)
|
||||
? $condition
|
||||
: static function () use ($condition): bool {
|
||||
return (bool) $condition; // @phpstan-ignore-line
|
||||
};
|
||||
|
||||
if ($condition()) {
|
||||
return $this->throws($exception, $exceptionMessage);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs the current test multiple times with
|
||||
* each item of the given `iterable`.
|
||||
@ -140,7 +160,7 @@ final class TestCall
|
||||
|
||||
$condition = is_callable($condition)
|
||||
? $condition
|
||||
: function () use ($condition) { /* @phpstan-ignore-line */
|
||||
: function () use ($condition) {
|
||||
return $condition;
|
||||
};
|
||||
|
||||
@ -163,7 +183,7 @@ final class TestCall
|
||||
*/
|
||||
public function __get(string $name): self
|
||||
{
|
||||
return $this->addChain($name);
|
||||
return $this->addChain(Backtrace::file(), Backtrace::line(), $name);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,7 +193,7 @@ final class TestCall
|
||||
*/
|
||||
public function __call(string $name, array $arguments): self
|
||||
{
|
||||
return $this->addChain($name, $arguments);
|
||||
return $this->addChain(Backtrace::file(), Backtrace::line(), $name, $arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -181,11 +201,11 @@ final class TestCall
|
||||
*
|
||||
* @param array<int, mixed>|null $arguments
|
||||
*/
|
||||
private function addChain(string $name, array $arguments = null): self
|
||||
private function addChain(string $file, int $line, string $name, array $arguments = null): self
|
||||
{
|
||||
$this->testCaseFactory
|
||||
->chains
|
||||
->add(Backtrace::file(), Backtrace::line(), $name, $arguments);
|
||||
->add($file, $line, $name, $arguments);
|
||||
|
||||
if ($this->descriptionLess) {
|
||||
$exporter = new Exporter();
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '1.18.0';
|
||||
return '1.21.3';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
67
src/Plugins/Environment.php
Normal file
67
src/Plugins/Environment.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\Plugins;
|
||||
|
||||
use Pest\Contracts\Plugins\HandlesArguments;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Environment implements HandlesArguments
|
||||
{
|
||||
/**
|
||||
* The continuous integration environment.
|
||||
*/
|
||||
public const CI = 'ci';
|
||||
|
||||
/**
|
||||
* The local environment.
|
||||
*/
|
||||
public const LOCAL = 'local';
|
||||
|
||||
/**
|
||||
* @var \Pest\Plugins\Environment|null
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* The current environment.
|
||||
*
|
||||
* @var string|null
|
||||
*/
|
||||
private static $name;
|
||||
|
||||
/**
|
||||
* Allows to handle custom command line arguments.
|
||||
*
|
||||
* @param array<int, string> $arguments
|
||||
*
|
||||
* @return array<int, string> the updated list of arguments
|
||||
*/
|
||||
public function handleArguments(array $arguments): array
|
||||
{
|
||||
foreach ($arguments as $index => $argument) {
|
||||
if ($argument === '--ci') {
|
||||
unset($arguments[$index]);
|
||||
|
||||
self::$name = self::CI;
|
||||
}
|
||||
}
|
||||
|
||||
return array_values($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the environment name.
|
||||
*/
|
||||
public static function name(string $name = null): string
|
||||
{
|
||||
if (is_string($name)) {
|
||||
self::$name = $name;
|
||||
}
|
||||
|
||||
return self::$name ?? self::LOCAL;
|
||||
}
|
||||
}
|
||||
@ -11,6 +11,7 @@ use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\Exceptions\TestCaseAlreadyInUse;
|
||||
use Pest\Exceptions\TestCaseClassOrTraitNotFound;
|
||||
use Pest\Factories\TestCaseFactory;
|
||||
use Pest\Plugins\Environment;
|
||||
use Pest\Support\Reflection;
|
||||
use Pest\Support\Str;
|
||||
use Pest\TestSuite;
|
||||
@ -119,6 +120,10 @@ final class TestRepository
|
||||
*/
|
||||
private function testsUsingOnly(): array
|
||||
{
|
||||
if (Environment::name() === Environment::CI) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return array_filter($this->state, function ($testFactory): bool {
|
||||
return $testFactory->only;
|
||||
});
|
||||
|
||||
@ -26,6 +26,7 @@ final class Backtrace
|
||||
$current = null;
|
||||
|
||||
foreach (debug_backtrace(self::BACKTRACE_OPTIONS) as $trace) {
|
||||
assert(array_key_exists(self::FILE, $trace));
|
||||
if (Str::endsWith($trace[self::FILE], (string) realpath('vendor/phpunit/phpunit/src/Util/FileLoader.php'))) {
|
||||
break;
|
||||
}
|
||||
@ -45,7 +46,11 @@ final class Backtrace
|
||||
*/
|
||||
public static function file(): string
|
||||
{
|
||||
return debug_backtrace(self::BACKTRACE_OPTIONS)[1][self::FILE];
|
||||
$trace = debug_backtrace(self::BACKTRACE_OPTIONS)[1];
|
||||
|
||||
assert(array_key_exists(self::FILE, $trace));
|
||||
|
||||
return $trace[self::FILE];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -53,7 +58,11 @@ final class Backtrace
|
||||
*/
|
||||
public static function dirname(): string
|
||||
{
|
||||
return dirname(debug_backtrace(self::BACKTRACE_OPTIONS)[1][self::FILE]);
|
||||
$trace = debug_backtrace(self::BACKTRACE_OPTIONS)[1];
|
||||
|
||||
assert(array_key_exists(self::FILE, $trace));
|
||||
|
||||
return dirname($trace[self::FILE]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,6 +70,10 @@ final class Backtrace
|
||||
*/
|
||||
public static function line(): int
|
||||
{
|
||||
return debug_backtrace(self::BACKTRACE_OPTIONS)[1]['line'];
|
||||
$trace = debug_backtrace(self::BACKTRACE_OPTIONS)[1];
|
||||
|
||||
assert(array_key_exists('line', $trace));
|
||||
|
||||
return $trace['line'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,14 +30,21 @@ final class Coverage
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs true there is any code
|
||||
* coverage driver available.
|
||||
* Runs true there is any code coverage driver available.
|
||||
*/
|
||||
public static function isAvailable(): bool
|
||||
{
|
||||
return (new Runtime())->canCollectCodeCoverage();
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user is using Xdebug.
|
||||
*/
|
||||
public static function usingXdebug(): bool
|
||||
{
|
||||
return (new Runtime())->hasXdebug();
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports the code coverage report to the
|
||||
* console and returns the result in float.
|
||||
@ -45,6 +52,14 @@ final class Coverage
|
||||
public static function report(OutputInterface $output): float
|
||||
{
|
||||
if (!file_exists($reportPath = self::getPath())) {
|
||||
if (self::usingXdebug()) {
|
||||
$output->writeln(
|
||||
" <fg=black;bg=yellow;options=bold> WARN </> Unable to get coverage using Xdebug. Did you set <href=https://xdebug.org/docs/code_coverage#mode>Xdebug's coverage mode</>?</>",
|
||||
);
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
throw ShouldNotHappen::fromMessage(sprintf('Coverage not found in path: %s.', $reportPath));
|
||||
}
|
||||
|
||||
|
||||
@ -91,8 +91,8 @@ final class TestSuite
|
||||
$this->afterEach = new AfterEachRepository();
|
||||
$this->afterAll = new AfterAllRepository();
|
||||
|
||||
$this->rootPath = (string) realpath($rootPath);
|
||||
$this->testPath = $testPath;
|
||||
$this->rootPath = (string) realpath($rootPath);
|
||||
$this->testPath = $testPath;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -107,6 +107,11 @@
|
||||
✓ it catch exceptions
|
||||
✓ it catch exceptions and messages
|
||||
✓ it can just define the message
|
||||
✓ it not catch exceptions if given condition is false
|
||||
✓ it catch exceptions if given condition is true
|
||||
✓ it catch exceptions and messages if given condition is true
|
||||
✓ it can just define the message if given condition is true
|
||||
✓ it can just define the message if given condition is 1
|
||||
|
||||
PASS Tests\Features\Expect\HigherOrder\methods
|
||||
✓ it can access methods
|
||||
@ -158,6 +163,17 @@
|
||||
✓ it properly parses json string
|
||||
✓ fails with broken json string
|
||||
|
||||
PASS Tests\Features\Expect\matchExpectation
|
||||
✓ it pass
|
||||
✓ it failures
|
||||
✓ it runs with truthy
|
||||
✓ it runs with falsy
|
||||
✓ it runs with truthy closure condition
|
||||
✓ it runs with falsy closure condition
|
||||
✓ it can be passed non-callable values
|
||||
✓ it fails with unhandled match
|
||||
✓ it can be used in higher order tests
|
||||
|
||||
PASS Tests\Features\Expect\not
|
||||
✓ not property calls
|
||||
|
||||
@ -168,7 +184,7 @@
|
||||
✓ an exception is thrown if the the type is not iterable
|
||||
✓ allows for sequences of checks to be run on iterable data
|
||||
✓ loops back to the start if it runs out of sequence items
|
||||
✓ it works if the number of items in the iterable is smaller than the number of expectations
|
||||
✓ fails if the number of iterable items is greater than the number of expectations
|
||||
✓ it works with associative arrays
|
||||
✓ it can be passed non-callable values
|
||||
✓ it can be passed a mixture of value types
|
||||
@ -480,6 +496,26 @@
|
||||
✓ not failures
|
||||
✓ closure missing parameter
|
||||
✓ closure missing type-hint
|
||||
✓ it can handle a non-defined exception
|
||||
✓ it can handle a class not found Error
|
||||
|
||||
PASS Tests\Features\Expect\unless
|
||||
✓ it pass
|
||||
✓ it failures
|
||||
✓ it runs with truthy
|
||||
✓ it skips with falsy
|
||||
✓ it runs with truthy closure condition
|
||||
✓ it skips with falsy closure condition
|
||||
✓ it can be used in higher order tests
|
||||
|
||||
PASS Tests\Features\Expect\when
|
||||
✓ it pass
|
||||
✓ it failures
|
||||
✓ it runs with truthy
|
||||
✓ it skips with falsy
|
||||
✓ it runs with truthy closure condition
|
||||
✓ it skips with falsy closure condition
|
||||
✓ it can be used in higher order tests
|
||||
|
||||
PASS Tests\Features\Helpers
|
||||
✓ it can set/get properties on $this
|
||||
@ -623,6 +659,10 @@
|
||||
✓ it show the actual dataset of multiple non-named datasets in their description
|
||||
✓ it show the correct description for mixed named and not-named datasets
|
||||
|
||||
PASS Tests\Unit\Plugins\Environment
|
||||
✓ environment is set to CI when --ci option is used
|
||||
✓ environment is set to Local when --ci option is not used
|
||||
|
||||
PASS Tests\Unit\Plugins\Version
|
||||
✓ it outputs the version when --version is used
|
||||
✓ it do not outputs version when --version is not used
|
||||
@ -648,6 +688,7 @@
|
||||
✓ it alerts users about tests with arguments but no input
|
||||
✓ it can return an array of all test suite filenames
|
||||
✓ it can filter the test suite filenames to those with the only method
|
||||
✓ it does not filter the test suite filenames to those with the only method when working in CI pipeline
|
||||
|
||||
PASS Tests\Visual\Help
|
||||
✓ visual snapshot of help command output
|
||||
@ -681,5 +722,5 @@
|
||||
✓ it is a test
|
||||
✓ it uses correct parent class
|
||||
|
||||
Tests: 4 incompleted, 9 skipped, 447 passed
|
||||
Tests: 4 incompleted, 9 skipped, 480 passed
|
||||
|
||||
@ -8,7 +8,7 @@ use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
it('has plugin')->assertTrue(class_exists(CoveragePlugin::class));
|
||||
|
||||
it('adds coverage if --coverage exist', function () {
|
||||
$plugin = new CoveragePlugin(new ConsoleOutput());
|
||||
$plugin = new CoveragePlugin(new ConsoleOutput());
|
||||
$testSuite = TestSuite::getInstance();
|
||||
|
||||
expect($plugin->coverage)->toBeFalse();
|
||||
|
||||
@ -17,3 +17,23 @@ it('catch exceptions and messages', function () {
|
||||
it('can just define the message', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throws('Something bad happened');
|
||||
|
||||
it('not catch exceptions if given condition is false', function () {
|
||||
$this->assertTrue(true);
|
||||
})->throwsIf(false, Exception::class);
|
||||
|
||||
it('catch exceptions if given condition is true', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throwsIf(function () { return true; }, Exception::class);
|
||||
|
||||
it('catch exceptions and messages if given condition is true', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throwsIf(true, Exception::class, 'Something bad happened');
|
||||
|
||||
it('can just define the message if given condition is true', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throwsIf(true, 'Something bad happened');
|
||||
|
||||
it('can just define the message if given condition is 1', function () {
|
||||
throw new Exception('Something bad happened');
|
||||
})->throwsIf(1, 'Something bad happened');
|
||||
|
||||
148
tests/Features/Expect/matchExpectation.php
Normal file
148
tests/Features/Expect/matchExpectation.php
Normal file
@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
beforeEach(function () {
|
||||
$this->matched = null;
|
||||
});
|
||||
|
||||
it('pass', function () {
|
||||
expect('baz')
|
||||
->match('foo', [
|
||||
'bar' => function ($value) {
|
||||
$this->matched = 'bar';
|
||||
|
||||
return $value->toEqual('bar');
|
||||
},
|
||||
'foo' => function ($value) {
|
||||
$this->matched = 'baz';
|
||||
|
||||
return $value->toEqual('baz');
|
||||
},
|
||||
]
|
||||
)
|
||||
->toEqual($this->matched);
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('failures', function () {
|
||||
expect(true)
|
||||
->match('foo', [
|
||||
'bar' => function ($value) {
|
||||
return $value->toBeTrue();
|
||||
},
|
||||
'foo' => function ($value) {
|
||||
return $value->toBeFalse();
|
||||
},
|
||||
]
|
||||
);
|
||||
})->throws(ExpectationFailedException::class, 'true is false');
|
||||
|
||||
it('runs with truthy', function () {
|
||||
expect('foo')
|
||||
->match(1, [
|
||||
'bar' => function ($value) {
|
||||
$this->matched = 'bar';
|
||||
|
||||
return $value->toEqual('bar');
|
||||
},
|
||||
true => function ($value) {
|
||||
$this->matched = 'foo';
|
||||
|
||||
return $value->toEqual('foo');
|
||||
},
|
||||
]
|
||||
)
|
||||
->toEqual($this->matched);
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('runs with falsy', function () {
|
||||
expect('foo')
|
||||
->match(false, [
|
||||
'bar' => function ($value) {
|
||||
$this->matched = 'bar';
|
||||
|
||||
return $value->toEqual('bar');
|
||||
},
|
||||
false => function ($value) {
|
||||
$this->matched = 'foo';
|
||||
|
||||
return $value->toEqual('foo');
|
||||
},
|
||||
]
|
||||
)
|
||||
->toEqual($this->matched);
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('runs with truthy closure condition', function () {
|
||||
expect('foo')
|
||||
->match(
|
||||
function () { return '1'; }, [
|
||||
'bar' => function ($value) {
|
||||
$this->matched = 'bar';
|
||||
|
||||
return $value->toEqual('bar');
|
||||
},
|
||||
true => function ($value) {
|
||||
$this->matched = 'foo';
|
||||
|
||||
return $value->toEqual('foo');
|
||||
},
|
||||
]
|
||||
)
|
||||
->toEqual($this->matched);
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('runs with falsy closure condition', function () {
|
||||
expect('foo')
|
||||
->match(
|
||||
function () { return '0'; }, [
|
||||
'bar' => function ($value) {
|
||||
$this->matched = 'bar';
|
||||
|
||||
return $value->toEqual('bar');
|
||||
},
|
||||
false => function ($value) {
|
||||
$this->matched = 'foo';
|
||||
|
||||
return $value->toEqual('foo');
|
||||
},
|
||||
]
|
||||
)
|
||||
->toEqual($this->matched);
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('can be passed non-callable values', function () {
|
||||
expect('foo')
|
||||
->match('pest', [
|
||||
'bar' => 'foo',
|
||||
'pest' => 'baz',
|
||||
]
|
||||
);
|
||||
})->throws(ExpectationFailedException::class, 'two strings are equal');
|
||||
|
||||
it('fails with unhandled match', function () {
|
||||
expect('foo')->match('bar', []);
|
||||
})->throws(ExpectationFailedException::class, 'Unhandled match value.');
|
||||
|
||||
it('can be used in higher order tests')
|
||||
->expect(true)
|
||||
->match(
|
||||
function () { return true; }, [
|
||||
false => function ($value) {
|
||||
return $value->toBeFalse();
|
||||
},
|
||||
true => function ($value) {
|
||||
return $value->toBeTrue();
|
||||
},
|
||||
]
|
||||
);
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('an exception is thrown if the the type is not iterable', function () {
|
||||
expect('Foobar')->each->sequence();
|
||||
})->throws(BadMethodCallException::class, 'Expectation value is not iterable.');
|
||||
@ -26,16 +28,14 @@ test('loops back to the start if it runs out of sequence items', function () {
|
||||
expect(static::getCount())->toBe(16);
|
||||
});
|
||||
|
||||
test('it works if the number of items in the iterable is smaller than the number of expectations', function () {
|
||||
test('fails if the number of iterable items is greater than the number of expectations', function () {
|
||||
expect([1, 2])
|
||||
->sequence(
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(1); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(2); },
|
||||
function ($expectation) { $expectation->toBeInt()->toEqual(3); },
|
||||
);
|
||||
|
||||
expect(static::getCount())->toBe(4);
|
||||
});
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('it works with associative arrays', function () {
|
||||
expect(['foo' => 'bar', 'baz' => 'boom'])
|
||||
|
||||
@ -5,7 +5,7 @@ use PHPUnit\Framework\ExpectationFailedException;
|
||||
expect(true)->toBeTrue()->and(false)->toBeFalse();
|
||||
|
||||
test('strict comparisons', function () {
|
||||
$nuno = new stdClass();
|
||||
$nuno = new stdClass();
|
||||
$dries = new stdClass();
|
||||
|
||||
expect($nuno)->toBe($nuno)->not->toBe($dries);
|
||||
|
||||
@ -3,24 +3,24 @@
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
test('pass', function () {
|
||||
$object = new stdClass();
|
||||
$object = new stdClass();
|
||||
$object->name = 'Jhon';
|
||||
$object->age = 21;
|
||||
$object->age = 21;
|
||||
|
||||
expect($object)->toHaveProperties(['name', 'age']);
|
||||
});
|
||||
|
||||
test('failures', function () {
|
||||
$object = new stdClass();
|
||||
$object = new stdClass();
|
||||
$object->name = 'Jhon';
|
||||
|
||||
expect($object)->toHaveProperties(['name', 'age']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('not failures', function () {
|
||||
$object = new stdClass();
|
||||
$object = new stdClass();
|
||||
$object->name = 'Jhon';
|
||||
$object->age = 21;
|
||||
$object->age = 21;
|
||||
|
||||
expect($object)->not->toHaveProperties(['name', 'age']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
@ -58,3 +58,15 @@ test('closure missing parameter', function () {
|
||||
test('closure missing type-hint', function () {
|
||||
expect(function () {})->toThrow(function ($e) {});
|
||||
})->throws(InvalidArgumentException::class, 'The given closure\'s parameter must be type-hinted as the class string.');
|
||||
|
||||
it('can handle a non-defined exception', function () {
|
||||
expect(function () {
|
||||
throw new NonExistingException();
|
||||
})->toThrow(NonExistingException::class);
|
||||
})->throws(Error::class);
|
||||
|
||||
it('can handle a class not found Error', function () {
|
||||
expect(function () {
|
||||
throw new NonExistingException();
|
||||
})->toThrow(Error::class);
|
||||
});
|
||||
|
||||
101
tests/Features/Expect/unless.php
Normal file
101
tests/Features/Expect/unless.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
beforeEach(function () {
|
||||
$this->unlessObject = new stdClass();
|
||||
$this->unlessObject->trueValue = true;
|
||||
$this->unlessObject->foo = 'foo';
|
||||
});
|
||||
|
||||
it('pass', function () {
|
||||
expect('foo')
|
||||
->unless(
|
||||
true,
|
||||
function ($value) {
|
||||
return $value->toEqual('bar');
|
||||
}
|
||||
)
|
||||
->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(1);
|
||||
});
|
||||
|
||||
it('failures', function () {
|
||||
expect('foo')
|
||||
->unless(
|
||||
false,
|
||||
function ($value) {
|
||||
return $value->toBeTrue();
|
||||
}
|
||||
)
|
||||
->toEqual('foo');
|
||||
})->throws(ExpectationFailedException::class, 'is true');
|
||||
|
||||
it('runs with truthy', function () {
|
||||
expect($this->unlessObject)
|
||||
->unless(
|
||||
0,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeTrue();
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('skips with falsy', function () {
|
||||
expect($this->unlessObject)
|
||||
->unless(
|
||||
1,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->unless(
|
||||
true,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(1);
|
||||
});
|
||||
|
||||
it('runs with truthy closure condition', function () {
|
||||
expect($this->unlessObject)
|
||||
->unless(
|
||||
function () { return '0'; },
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeTrue();
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('skips with falsy closure condition', function () {
|
||||
expect($this->unlessObject)
|
||||
->unless(
|
||||
function () { return '1'; },
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(1);
|
||||
});
|
||||
|
||||
it('can be used in higher order tests')
|
||||
->expect(true)
|
||||
->unless(
|
||||
function () { return false; },
|
||||
function ($value) {
|
||||
return $value->toBeFalse();
|
||||
}
|
||||
)
|
||||
->throws(ExpectationFailedException::class, 'true is false');
|
||||
101
tests/Features/Expect/when.php
Normal file
101
tests/Features/Expect/when.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\ExpectationFailedException;
|
||||
|
||||
beforeEach(function () {
|
||||
$this->whenObject = new stdClass();
|
||||
$this->whenObject->trueValue = true;
|
||||
$this->whenObject->foo = 'foo';
|
||||
});
|
||||
|
||||
it('pass', function () {
|
||||
expect('foo')
|
||||
->when(
|
||||
true,
|
||||
function ($value) {
|
||||
return $value->toEqual('foo');
|
||||
}
|
||||
)
|
||||
->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('failures', function () {
|
||||
expect('foo')
|
||||
->when(
|
||||
true,
|
||||
function ($value) {
|
||||
return $value->toBeTrue();
|
||||
}
|
||||
)
|
||||
->toEqual('foo');
|
||||
})->throws(ExpectationFailedException::class, 'is true');
|
||||
|
||||
it('runs with truthy', function () {
|
||||
expect($this->whenObject)
|
||||
->when(
|
||||
1,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeTrue();
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('skips with falsy', function () {
|
||||
expect($this->whenObject)
|
||||
->when(
|
||||
0,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->when(
|
||||
false,
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(1);
|
||||
});
|
||||
|
||||
it('runs with truthy closure condition', function () {
|
||||
expect($this->whenObject)
|
||||
->when(
|
||||
function () { return '1'; },
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeTrue();
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(2);
|
||||
});
|
||||
|
||||
it('skips with falsy closure condition', function () {
|
||||
expect($this->whenObject)
|
||||
->when(
|
||||
function () { return '0'; },
|
||||
function ($value) {
|
||||
return $value->trueValue->toBeFalse(); // fails
|
||||
}
|
||||
)
|
||||
->foo->toEqual('foo');
|
||||
|
||||
expect(static::getCount())->toBe(1);
|
||||
});
|
||||
|
||||
it('can be used in higher order tests')
|
||||
->expect(false)
|
||||
->when(
|
||||
function () { return true; },
|
||||
function ($value) {
|
||||
return $value->toBeTrue();
|
||||
}
|
||||
)
|
||||
->throws(ExpectationFailedException::class, 'false is true');
|
||||
@ -23,7 +23,7 @@ test('default php unit tests', function () {
|
||||
});
|
||||
|
||||
it('removes warnings', function () {
|
||||
$testSuite = new TestSuite();
|
||||
$testSuite = new TestSuite();
|
||||
$warningTestCase = new WarningTestCase('No tests found in class "Pest\TestCase".');
|
||||
$testSuite->addTest($warningTestCase);
|
||||
|
||||
|
||||
23
tests/Unit/Plugins/Environment.php
Normal file
23
tests/Unit/Plugins/Environment.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Pest\Plugins\Environment;
|
||||
|
||||
test('environment is set to CI when --ci option is used', function () {
|
||||
$previousName = Environment::name();
|
||||
|
||||
$plugin = new Environment();
|
||||
|
||||
$plugin->handleArguments(['foo', '--ci', 'bar']);
|
||||
|
||||
expect(Environment::name())->toBe(Environment::CI);
|
||||
|
||||
Environment::name($previousName);
|
||||
});
|
||||
|
||||
test('environment is set to Local when --ci option is not used', function () {
|
||||
$plugin = new Environment();
|
||||
|
||||
$plugin->handleArguments(['foo', 'bar', 'baz']);
|
||||
|
||||
expect(Environment::name())->toBe(Environment::LOCAL);
|
||||
});
|
||||
@ -10,7 +10,7 @@ it('gets file name from closure', function () {
|
||||
});
|
||||
|
||||
it('gets property values', function () {
|
||||
$class = new class() {
|
||||
$class = new class() {
|
||||
private $foo = 'bar';
|
||||
};
|
||||
|
||||
|
||||
@ -2,13 +2,15 @@
|
||||
|
||||
use Pest\Exceptions\DatasetMissing;
|
||||
use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\Factories\TestCaseFactory;
|
||||
use Pest\Plugins\Environment;
|
||||
use Pest\TestSuite;
|
||||
|
||||
it('does not allow to add the same test description twice', function () {
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test));
|
||||
})->throws(
|
||||
TestAlreadyExist::class,
|
||||
sprintf('A test with the description `%s` already exist in the filename `%s`.', 'foo', __FILE__),
|
||||
@ -16,18 +18,18 @@ it('does not allow to add the same test description twice', function () {
|
||||
|
||||
it('alerts users about tests with arguments but no input', function () {
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
$test = function (int $arg) {};
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$test = function (int $arg) {};
|
||||
$testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test));
|
||||
})->throws(
|
||||
DatasetMissing::class,
|
||||
sprintf("A test with the description '%s' has %d argument(s) ([%s]) and no dataset(s) provided in %s", 'foo', 1, 'int $arg', __FILE__),
|
||||
);
|
||||
|
||||
it('can return an array of all test suite filenames', function () {
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'bar', $test));
|
||||
$testSuite = TestSuite::getInstance(getcwd(), 'tests');
|
||||
$test = function () {};
|
||||
$testSuite->tests->set(new TestCaseFactory(__FILE__, 'foo', $test));
|
||||
$testSuite->tests->set(new TestCaseFactory(__FILE__, 'bar', $test));
|
||||
|
||||
expect($testSuite->tests->getFilenames())->toEqual([
|
||||
__FILE__,
|
||||
@ -37,15 +39,36 @@ it('can return an array of all test suite filenames', function () {
|
||||
|
||||
it('can filter the test suite filenames to those with the only method', function () {
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
$test = function () {};
|
||||
$test = function () {};
|
||||
|
||||
$testWithOnly = new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test);
|
||||
$testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test);
|
||||
$testWithOnly->only = true;
|
||||
$testSuite->tests->set($testWithOnly);
|
||||
|
||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory('Baz/Bar/Boo.php', 'bar', $test));
|
||||
$testSuite->tests->set(new TestCaseFactory('Baz/Bar/Boo.php', 'bar', $test));
|
||||
|
||||
expect($testSuite->tests->getFilenames())->toEqual([
|
||||
__FILE__,
|
||||
]);
|
||||
});
|
||||
|
||||
it('does not filter the test suite filenames to those with the only method when working in CI pipeline', function () {
|
||||
$previousEnvironment = Environment::name();
|
||||
Environment::name(Environment::CI);
|
||||
$testSuite = TestSuite::getInstance(getcwd(), 'tests');
|
||||
|
||||
$test = function () {};
|
||||
|
||||
$testWithOnly = new TestCaseFactory(__FILE__, 'foo', $test);
|
||||
$testWithOnly->only = true;
|
||||
$testSuite->tests->set($testWithOnly);
|
||||
|
||||
$testSuite->tests->set(new TestCaseFactory('Baz/Bar/Boo.php', 'bar', $test));
|
||||
|
||||
expect($testSuite->tests->getFilenames())->toEqual([
|
||||
__FILE__,
|
||||
'Baz/Bar/Boo.php',
|
||||
]);
|
||||
|
||||
Environment::name($previousEnvironment);
|
||||
});
|
||||
|
||||
@ -8,7 +8,7 @@ test('visual snapshot of help command output', function () {
|
||||
|
||||
if (getenv('REBUILD_SNAPSHOTS')) {
|
||||
$outputBuffer = new BufferedOutput();
|
||||
$plugin = new Help($outputBuffer);
|
||||
$plugin = new Help($outputBuffer);
|
||||
|
||||
$plugin();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
test('visual snapshot of test suite on success', function () {
|
||||
$testsPath = dirname(__DIR__);
|
||||
$snapshot = implode(DIRECTORY_SEPARATOR, [
|
||||
$snapshot = implode(DIRECTORY_SEPARATOR, [
|
||||
$testsPath,
|
||||
'.snapshots',
|
||||
'success.txt',
|
||||
|
||||
0
tests/Visual/junit.html
Normal file
0
tests/Visual/junit.html
Normal file
Reference in New Issue
Block a user