mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23eebc8127 | |||
| 3b435e460e | |||
| b52e9826e7 | |||
| ba49dd0499 | |||
| f9f6f28950 | |||
| f017015d1e | |||
| 29b4ee33bb | |||
| 03dc11c2f6 | |||
| b79ba5098b | |||
| 3c418d82e6 | |||
| 73ede2e344 | |||
| 266d891488 | |||
| c71490b472 | |||
| 07705079e2 | |||
| d88c268426 | |||
| a1b142e885 | |||
| a50d739e50 | |||
| f82bb56d89 | |||
| de593c3b93 | |||
| eedd5d80a0 | |||
| 5bbdd4f41e | |||
| 3fd24d96d3 | |||
| 7bea51fe09 | |||
| cdf0a38145 | |||
| bb2474ccbe | |||
| 01143a6f84 | |||
| b93485c2ed | |||
| 04681690b6 | |||
| 200877d691 | |||
| feb6417f45 | |||
| e7585a4ba2 | |||
| c33ab0f670 | |||
| 78181f66f6 | |||
| 925636be61 | |||
| 6be131d602 | |||
| f950f57eed | |||
| c6369feaea | |||
| 1bdd3f4908 | |||
| 924e095dfc | |||
| 72041a4a21 | |||
| d576446639 | |||
| 3fbec70ed3 | |||
| d177ab5ec2 | |||
| e4f5a284a6 | |||
| 6671b266da | |||
| 3728bd8e0f | |||
| c3616edbc8 | |||
| 21143b2693 | |||
| 006f9232cc | |||
| d1b61a34de | |||
| 896317ac97 | |||
| 4fd5c0edd4 | |||
| e2c5d6d857 | |||
| 8057fe4bc2 | |||
| ebc9690301 | |||
| 36fd18bcc8 | |||
| aa352317cb | |||
| edcd2cb50e |
19
.github/workflows/changelog.yml
vendored
19
.github/workflows/changelog.yml
vendored
@ -5,6 +5,7 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
paths:
|
paths:
|
||||||
- CHANGELOG.md
|
- CHANGELOG.md
|
||||||
|
- .github/workflows/changelog.yml
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
paths:
|
paths:
|
||||||
@ -17,17 +18,21 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Checkout website repository
|
- name: Checkout website repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CHANGELOG_KEY }}
|
token: ${{ secrets.CHANGELOG_KEY }}
|
||||||
repository: pestphp/website
|
repository: pestphp/docs
|
||||||
path: pestphp-website
|
path: pestphp-docs
|
||||||
|
ref: master
|
||||||
|
|
||||||
- name: Read CHANGELOG.md
|
- name: Read CHANGELOG.md
|
||||||
id: package
|
id: package
|
||||||
uses: juliangruber/read-file-action@v1
|
uses: juliangruber/read-file-action@v1
|
||||||
with:
|
with:
|
||||||
path: ./CHANGELOG.md
|
path: ./CHANGELOG.md
|
||||||
|
|
||||||
- name: Add file headers
|
- name: Add file headers
|
||||||
uses: DamianReeves/write-file-action@v1.0
|
uses: DamianReeves/write-file-action@v1.0
|
||||||
with:
|
with:
|
||||||
@ -36,8 +41,6 @@ jobs:
|
|||||||
---
|
---
|
||||||
title: Changelog
|
title: Changelog
|
||||||
description: Changelog
|
description: Changelog
|
||||||
extends: _layouts.documentation
|
|
||||||
section: content
|
|
||||||
---
|
---
|
||||||
${{ steps.package.outputs.content }}
|
${{ steps.package.outputs.content }}
|
||||||
|
|
||||||
@ -45,14 +48,16 @@ jobs:
|
|||||||
|
|
||||||
Next section: [Upgrade Guide →](/docs/upgrade-guide)
|
Next section: [Upgrade Guide →](/docs/upgrade-guide)
|
||||||
write-mode: overwrite
|
write-mode: overwrite
|
||||||
|
|
||||||
- name: Copy CHANGELOG to website repository
|
- name: Copy CHANGELOG to website repository
|
||||||
run: cp CHANGELOG.md pestphp-website/source/docs/changelog.md
|
run: cp CHANGELOG.md pestphp-docs/changelog.md
|
||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@v2
|
uses: peter-evans/create-pull-request@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CHANGELOG_KEY }}
|
token: ${{ secrets.CHANGELOG_KEY }}
|
||||||
commit-message: Update changelog.md
|
commit-message: Update changelog.md
|
||||||
committer: GitHub Action <noreply@github.com>
|
committer: GitHub Action <noreply@github.com>
|
||||||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
|
||||||
title: 'Update changelog.md'
|
title: 'Update changelog.md'
|
||||||
path: ./pestphp-website
|
path: ./pestphp-docs
|
||||||
|
|||||||
39
CHANGELOG.md
39
CHANGELOG.md
@ -4,7 +4,44 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
## [Unreleased]
|
## [v0.3.15 (2020-12-04)](https://github.com/pestphp/pest/compare/v0.3.14...v0.3.15)
|
||||||
|
### Added
|
||||||
|
- Support for PHPUnit 9.5.0 ([#234](https://github.com/pestphp/pest/pull/234))
|
||||||
|
- Support for extending expectation API ([#232](https://github.com/pestphp/pest/pull/232))
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Static analysis while using string as key for datasets ([#233](https://github.com/pestphp/pest/pull/233))
|
||||||
|
|
||||||
|
## [v0.3.14 (2020-11-28)](https://github.com/pestphp/pest/compare/v0.3.13...v0.3.14)
|
||||||
|
### Added
|
||||||
|
- `pest:dusk` command ([#223](https://github.com/pestphp/pest/pull/223))
|
||||||
|
- Better feedback on errors in `toMatchArray` and `toMatchObject` ([#231](https://github.com/pestphp/pest/pull/231))
|
||||||
|
|
||||||
|
## [v0.3.13 (2020-11-23)](https://github.com/pestphp/pest/compare/v0.3.12...v0.3.13)
|
||||||
|
### Added
|
||||||
|
- `toMatchArray` expectation ([7bea51f](https://github.com/pestphp/pest/commit/7bea51fe09dd2eca7093e4c34cf2dab2e8d39fa5), [3fd24d9](https://github.com/pestphp/pest/commit/3fd24d96d3145dcebdb0aab40aa8b76faa8b6979))
|
||||||
|
- Add Pest options to `--help` output ([#217](https://github.com/pestphp/pest/pull/217))
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Resolve issue with name resolution in `depends()` ([#216](https://github.com/pestphp/pest/pull/216))
|
||||||
|
|
||||||
|
## [v0.3.12 (2020-11-11)](https://github.com/pestphp/pest/compare/v0.3.11...v0.3.12)
|
||||||
|
### Added
|
||||||
|
- Add support for PHPUnit 9.4.3 ([#219](https://github.com/pestphp/pest/pull/219))
|
||||||
|
|
||||||
|
## [v0.3.11 (2020-11-09)](https://github.com/pestphp/pest/compare/v0.3.10...v0.3.11)
|
||||||
|
### Changed
|
||||||
|
- Improved the exception output for the TeamCity printer (usage with phpstorm plugin) ([#215](https://github.com/pestphp/pest/pull/215))
|
||||||
|
|
||||||
|
## [v0.3.10 (2020-11-01)](https://github.com/pestphp/pest/compare/v0.3.9...v0.3.10)
|
||||||
|
### Added
|
||||||
|
- Add support for PHPUnit 9.4.2 ([d177ab5](https://github.com/pestphp/pest/commit/d177ab5ec2030c5bb8e418d10834c370c94c433d))
|
||||||
|
|
||||||
|
## [v0.3.9 (2020-10-13)](https://github.com/pestphp/pest/compare/v0.3.8...v0.3.9)
|
||||||
|
### Added
|
||||||
|
- Add support for named datasets in description output ([#134](https://github.com/pestphp/pest/pull/134))
|
||||||
|
- Add Pest version to `--help` output ([#203](https://github.com/pestphp/pest/pull/203))
|
||||||
|
- Add support for PHPUnit 9.4.1 ([#207](https://github.com/pestphp/pest/pull/207))
|
||||||
|
|
||||||
## [v0.3.8 (2020-10-03)](https://github.com/pestphp/pest/compare/v0.3.7...v0.3.8)
|
## [v0.3.8 (2020-10-03)](https://github.com/pestphp/pest/compare/v0.3.7...v0.3.8)
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
16
RELEASE.md
Normal file
16
RELEASE.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Release process
|
||||||
|
|
||||||
|
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
|
||||||
|
- 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 "docs: update changelog"`
|
||||||
|
- 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`
|
||||||
|
|
||||||
|
### Plugins
|
||||||
|
|
||||||
|
Plugins should be versioned using the same major (or minor for `0.x` releases) version as Pest core.
|
||||||
@ -22,7 +22,7 @@
|
|||||||
"pestphp/pest-plugin": "^0.3",
|
"pestphp/pest-plugin": "^0.3",
|
||||||
"pestphp/pest-plugin-coverage": "^0.3",
|
"pestphp/pest-plugin-coverage": "^0.3",
|
||||||
"pestphp/pest-plugin-init": "^0.3",
|
"pestphp/pest-plugin-init": "^0.3",
|
||||||
"phpunit/phpunit": ">= 9.3.7 <= 9.4.0"
|
"phpunit/phpunit": ">= 9.3.7 <= 9.5.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
@ -44,6 +44,7 @@
|
|||||||
"require-dev": {
|
"require-dev": {
|
||||||
"illuminate/console": "^7.16.1",
|
"illuminate/console": "^7.16.1",
|
||||||
"illuminate/support": "^7.16.1",
|
"illuminate/support": "^7.16.1",
|
||||||
|
"laravel/dusk": "^6.9.0",
|
||||||
"mockery/mockery": "^1.4.1",
|
"mockery/mockery": "^1.4.1",
|
||||||
"pestphp/pest-dev-tools": "dev-master"
|
"pestphp/pest-dev-tools": "dev-master"
|
||||||
},
|
},
|
||||||
|
|||||||
55
src/Concerns/Extendable.php
Normal file
55
src/Concerns/Extendable.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Pest\Concerns;
|
||||||
|
|
||||||
|
use BadMethodCallException;
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
trait Extendable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @var array<string, Closure>
|
||||||
|
*/
|
||||||
|
private static $extends = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a custom extend.
|
||||||
|
*/
|
||||||
|
public static function extend(string $name, Closure $extend): void
|
||||||
|
{
|
||||||
|
static::$extends[$name] = $extend;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if extend is registered.
|
||||||
|
*/
|
||||||
|
public static function hasExtend(string $name): bool
|
||||||
|
{
|
||||||
|
return array_key_exists($name, static::$extends);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dynamically handle calls to the class.
|
||||||
|
*
|
||||||
|
* @param array<int, mixed> $parameters
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws BadMethodCallException
|
||||||
|
*/
|
||||||
|
public function __call(string $method, array $parameters)
|
||||||
|
{
|
||||||
|
if (!static::hasExtend($method)) {
|
||||||
|
throw new BadMethodCallException(sprintf('Method %s::%s does not exist.', static::class, $method));
|
||||||
|
}
|
||||||
|
|
||||||
|
$extend = static::$extends[$method]->bindTo($this, static::class);
|
||||||
|
|
||||||
|
return $extend(...$parameters);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,6 +11,8 @@ use Pest\Actions\ValidatesConfiguration;
|
|||||||
use Pest\Contracts\Plugins\AddsOutput;
|
use Pest\Contracts\Plugins\AddsOutput;
|
||||||
use Pest\Contracts\Plugins\HandlesArguments;
|
use Pest\Contracts\Plugins\HandlesArguments;
|
||||||
use Pest\Plugin\Loader;
|
use Pest\Plugin\Loader;
|
||||||
|
use Pest\Plugins\Version;
|
||||||
|
use Pest\Support\Container;
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use PHPUnit\Framework\TestSuite as BaseTestSuite;
|
use PHPUnit\Framework\TestSuite as BaseTestSuite;
|
||||||
use PHPUnit\TextUI\Command as BaseCommand;
|
use PHPUnit\TextUI\Command as BaseCommand;
|
||||||
@ -139,4 +141,14 @@ final class Command extends BaseCommand
|
|||||||
|
|
||||||
exit($result);
|
exit($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function showHelp(): void
|
||||||
|
{
|
||||||
|
/** @var Version $version */
|
||||||
|
$version = Container::getInstance()->get(Version::class);
|
||||||
|
$version->handleArguments(['--version']);
|
||||||
|
parent::showHelp();
|
||||||
|
|
||||||
|
(new Help($this->output))();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
37
src/Console/Help.php
Normal file
37
src/Console/Help.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Pest\Console;
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
final class Help
|
||||||
|
{
|
||||||
|
/** @var array<int, string> */
|
||||||
|
private const HELP_MESSAGES = [
|
||||||
|
'<comment>Pest Options:</comment>',
|
||||||
|
' <info>--init</info> Initialise a standard Pest configuration',
|
||||||
|
' <info>--coverage</info> Enable coverage and output to standard output',
|
||||||
|
' <info>--min=<fg=cyan><N></></info> Set the minimum required coverage percentage (<N>), and fail if not met',
|
||||||
|
' <info>--group=<fg=cyan><name></></info> Only runs tests from the specified group(s)',
|
||||||
|
];
|
||||||
|
|
||||||
|
/** @var OutputInterface */
|
||||||
|
private $output;
|
||||||
|
|
||||||
|
public function __construct(OutputInterface $output)
|
||||||
|
{
|
||||||
|
$this->output = $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function __invoke(): void
|
||||||
|
{
|
||||||
|
foreach (self::HELP_MESSAGES as $message) {
|
||||||
|
$this->output->writeln($message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -51,7 +51,7 @@ final class Datasets
|
|||||||
/**
|
/**
|
||||||
* Resolves the current dataset to an array value.
|
* Resolves the current dataset to an array value.
|
||||||
*
|
*
|
||||||
* @param Traversable<int, mixed>|Closure|iterable<int, mixed>|string|null $data
|
* @param Traversable<int|string, mixed>|Closure|iterable<int|string, mixed>|string|null $data
|
||||||
*
|
*
|
||||||
* @return array<string, mixed>
|
* @return array<string, mixed>
|
||||||
*/
|
*/
|
||||||
@ -77,10 +77,10 @@ final class Datasets
|
|||||||
$dataSetDescriptions = [];
|
$dataSetDescriptions = [];
|
||||||
$dataSetValues = [];
|
$dataSetValues = [];
|
||||||
|
|
||||||
foreach ($data as $values) {
|
foreach ($data as $key => $values) {
|
||||||
$values = is_array($values) ? $values : [$values];
|
$values = is_array($values) ? $values : [$values];
|
||||||
|
|
||||||
$dataSetDescriptions[] = $description . self::getDataSetDescription($values);
|
$dataSetDescriptions[] = $description . self::getDataSetDescription($key, $values);
|
||||||
$dataSetValues[] = $values;
|
$dataSetValues[] = $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,12 +104,15 @@ final class Datasets
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param int|string $key
|
||||||
* @param array<int, mixed> $data
|
* @param array<int, mixed> $data
|
||||||
*/
|
*/
|
||||||
private static function getDataSetDescription(array $data): string
|
private static function getDataSetDescription($key, array $data): string
|
||||||
{
|
{
|
||||||
$exporter = new Exporter();
|
$exporter = new Exporter();
|
||||||
|
|
||||||
return \sprintf(' with (%s)', $exporter->shortenedRecursiveExport($data));
|
$nameInsert = is_string($key) ? \sprintf('data set "%s" ', $key) : '';
|
||||||
|
|
||||||
|
return \sprintf(' with %s(%s)', $nameInsert, $exporter->shortenedRecursiveExport($data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,8 +4,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Pest;
|
namespace Pest;
|
||||||
|
|
||||||
|
use Pest\Concerns\Extendable;
|
||||||
use PHPUnit\Framework\Assert;
|
use PHPUnit\Framework\Assert;
|
||||||
use PHPUnit\Framework\Constraint\Constraint;
|
use PHPUnit\Framework\Constraint\Constraint;
|
||||||
|
use SebastianBergmann\Exporter\Exporter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -14,6 +16,8 @@ use PHPUnit\Framework\Constraint\Constraint;
|
|||||||
*/
|
*/
|
||||||
final class Expectation
|
final class Expectation
|
||||||
{
|
{
|
||||||
|
use Extendable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The expectation value.
|
* The expectation value.
|
||||||
*
|
*
|
||||||
@ -23,6 +27,15 @@ final class Expectation
|
|||||||
*/
|
*/
|
||||||
public $value;
|
public $value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The exporter instance, if any.
|
||||||
|
*
|
||||||
|
* @readonly
|
||||||
|
*
|
||||||
|
* @var Exporter|null
|
||||||
|
*/
|
||||||
|
private $exporter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new expectation.
|
* Creates a new expectation.
|
||||||
*
|
*
|
||||||
@ -408,10 +421,21 @@ final class Expectation
|
|||||||
* Asserts that the value array has the provided $key.
|
* Asserts that the value array has the provided $key.
|
||||||
*
|
*
|
||||||
* @param string|int $key
|
* @param string|int $key
|
||||||
|
* @param mixed $value
|
||||||
*/
|
*/
|
||||||
public function toHaveKey($key): Expectation
|
public function toHaveKey($key, $value = null): Expectation
|
||||||
{
|
{
|
||||||
Assert::assertArrayHasKey($key, $this->value);
|
if (is_object($this->value) && method_exists($this->value, 'toArray')) {
|
||||||
|
$array = $this->value->toArray();
|
||||||
|
} else {
|
||||||
|
$array = (array) $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert::assertArrayHasKey($key, $array);
|
||||||
|
|
||||||
|
if (func_num_args() > 1) {
|
||||||
|
Assert::assertEquals($value, $array[$key]);
|
||||||
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -490,6 +514,36 @@ final class Expectation
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asserts that the value array matches the given array subset.
|
||||||
|
*
|
||||||
|
* @param array<int|string, mixed> $array
|
||||||
|
*/
|
||||||
|
public function toMatchArray($array): Expectation
|
||||||
|
{
|
||||||
|
if (is_object($this->value) && method_exists($this->value, 'toArray')) {
|
||||||
|
$valueAsArray = $this->value->toArray();
|
||||||
|
} else {
|
||||||
|
$valueAsArray = (array) $this->value;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($array as $key => $value) {
|
||||||
|
Assert::assertArrayHasKey($key, $valueAsArray);
|
||||||
|
|
||||||
|
Assert::assertEquals(
|
||||||
|
$value,
|
||||||
|
$valueAsArray[$key],
|
||||||
|
sprintf(
|
||||||
|
'Failed asserting that an array has a key %s with the value %s.',
|
||||||
|
$this->export($key),
|
||||||
|
$this->export($valueAsArray[$key]),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the value object matches a subset
|
* Asserts that the value object matches a subset
|
||||||
* of the properties of an given object.
|
* of the properties of an given object.
|
||||||
@ -499,7 +553,19 @@ final class Expectation
|
|||||||
public function toMatchObject($object): Expectation
|
public function toMatchObject($object): Expectation
|
||||||
{
|
{
|
||||||
foreach ((array) $object as $property => $value) {
|
foreach ((array) $object as $property => $value) {
|
||||||
$this->toHaveProperty($property, $value);
|
Assert::assertTrue(property_exists($this->value, $property));
|
||||||
|
|
||||||
|
/* @phpstan-ignore-next-line */
|
||||||
|
$propertyValue = $this->value->{$property};
|
||||||
|
Assert::assertEquals(
|
||||||
|
$value,
|
||||||
|
$propertyValue,
|
||||||
|
sprintf(
|
||||||
|
'Failed asserting that an object has a property %s with the value %s.',
|
||||||
|
$this->export($property),
|
||||||
|
$this->export($propertyValue),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -525,6 +591,20 @@ final class Expectation
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exports the given value.
|
||||||
|
*
|
||||||
|
* @param mixed $value
|
||||||
|
*/
|
||||||
|
private function export($value): string
|
||||||
|
{
|
||||||
|
if ($this->exporter === null) {
|
||||||
|
$this->exporter = new Exporter();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->exporter->export($value);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dynamically calls methods on the class without any arguments.
|
* Dynamically calls methods on the class without any arguments.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -59,7 +59,7 @@ final class TestCaseFactory
|
|||||||
/**
|
/**
|
||||||
* Holds the dataset, if any.
|
* Holds the dataset, if any.
|
||||||
*
|
*
|
||||||
* @var Closure|iterable<int, mixed>|string|null
|
* @var Closure|iterable<int|string, mixed>|string|null
|
||||||
*/
|
*/
|
||||||
public $dataset;
|
public $dataset;
|
||||||
|
|
||||||
|
|||||||
41
src/Laravel/Commands/PestDuskCommand.php
Normal file
41
src/Laravel/Commands/PestDuskCommand.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Pest\Laravel\Commands;
|
||||||
|
|
||||||
|
use Laravel\Dusk\Console\DuskCommand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
final class PestDuskCommand extends DuskCommand
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The console command name.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'pest:dusk {--without-tty : Disable output to TTY}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Run the Dusk tests for the application with Pest';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the PHP binary to execute.
|
||||||
|
*
|
||||||
|
* @return array<string>
|
||||||
|
*/
|
||||||
|
protected function binary()
|
||||||
|
{
|
||||||
|
if ('phpdbg' === PHP_SAPI) {
|
||||||
|
return [PHP_BINARY, '-qrr', 'vendor/bin/pest'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [PHP_BINARY, 'vendor/bin/pest'];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -5,7 +5,9 @@ declare(strict_types=1);
|
|||||||
namespace Pest\Laravel;
|
namespace Pest\Laravel;
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Laravel\Dusk\Console\DuskCommand;
|
||||||
use Pest\Laravel\Commands\PestDatasetCommand;
|
use Pest\Laravel\Commands\PestDatasetCommand;
|
||||||
|
use Pest\Laravel\Commands\PestDuskCommand;
|
||||||
use Pest\Laravel\Commands\PestInstallCommand;
|
use Pest\Laravel\Commands\PestInstallCommand;
|
||||||
use Pest\Laravel\Commands\PestTestCommand;
|
use Pest\Laravel\Commands\PestTestCommand;
|
||||||
|
|
||||||
@ -22,6 +24,12 @@ final class PestServiceProvider extends ServiceProvider
|
|||||||
PestTestCommand::class,
|
PestTestCommand::class,
|
||||||
PestDatasetCommand::class,
|
PestDatasetCommand::class,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (class_exists(DuskCommand::class)) {
|
||||||
|
$this->commands([
|
||||||
|
PestDuskCommand::class,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ final class TestCall
|
|||||||
* Runs the current test multiple times with
|
* Runs the current test multiple times with
|
||||||
* each item of the given `iterable`.
|
* each item of the given `iterable`.
|
||||||
*
|
*
|
||||||
* @param \Closure|iterable<int, mixed>|string $data
|
* @param \Closure|iterable<int|string, mixed>|string $data
|
||||||
*/
|
*/
|
||||||
public function with($data): TestCall
|
public function with($data): TestCall
|
||||||
{
|
{
|
||||||
@ -95,7 +95,11 @@ final class TestCall
|
|||||||
$className = $this->testCaseFactory->getClassName();
|
$className = $this->testCaseFactory->getClassName();
|
||||||
|
|
||||||
$tests = array_map(function (string $test) use ($className): ExecutionOrderDependency {
|
$tests = array_map(function (string $test) use ($className): ExecutionOrderDependency {
|
||||||
return ExecutionOrderDependency::createFromDependsAnnotation($className, $test);
|
if (strpos($test, '::') === false) {
|
||||||
|
$test = "{$className}::{$test}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ExecutionOrderDependency($test, null, '');
|
||||||
}, $tests);
|
}, $tests);
|
||||||
|
|
||||||
$this->testCaseFactory
|
$this->testCaseFactory
|
||||||
|
|||||||
@ -6,5 +6,5 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '0.3.6';
|
return '0.3.15';
|
||||||
}
|
}
|
||||||
|
|||||||
33
src/Support/Extendable.php
Normal file
33
src/Support/Extendable.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Pest\Support;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
|
final class Extendable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The extendable class.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $extendableClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new extendable instance.
|
||||||
|
*/
|
||||||
|
public function __construct(string $extendableClass)
|
||||||
|
{
|
||||||
|
$this->extendableClass = $extendableClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a custom extend.
|
||||||
|
*/
|
||||||
|
public function extend(string $name, Closure $extend): void
|
||||||
|
{
|
||||||
|
$this->extendableClass::extend($name, $extend);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -24,7 +24,6 @@ final class TeamCity extends DefaultResultPrinter
|
|||||||
private const DURATION = 'duration';
|
private const DURATION = 'duration';
|
||||||
private const TEST_SUITE_STARTED = 'testSuiteStarted';
|
private const TEST_SUITE_STARTED = 'testSuiteStarted';
|
||||||
private const TEST_SUITE_FINISHED = 'testSuiteFinished';
|
private const TEST_SUITE_FINISHED = 'testSuiteFinished';
|
||||||
private const TEST_FAILED = 'testFailed';
|
|
||||||
|
|
||||||
/** @var int */
|
/** @var int */
|
||||||
private $flowId;
|
private $flowId;
|
||||||
@ -149,19 +148,7 @@ final class TeamCity extends DefaultResultPrinter
|
|||||||
*/
|
*/
|
||||||
public function addError(Test $test, Throwable $t, float $time): void
|
public function addError(Test $test, Throwable $t, float $time): void
|
||||||
{
|
{
|
||||||
if (!TeamCity::isPestTest($test)) {
|
$this->phpunitTeamCity->addError($test, $t, $time);
|
||||||
$this->phpunitTeamCity->addError($test, $t, $time);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->printEvent(
|
|
||||||
self::TEST_FAILED, [
|
|
||||||
self::NAME => $test->getName(),
|
|
||||||
'message' => $t->getMessage(),
|
|
||||||
'details' => $t->getTraceAsString(),
|
|
||||||
self::DURATION => self::toMilliseconds($time),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -171,19 +158,7 @@ final class TeamCity extends DefaultResultPrinter
|
|||||||
*/
|
*/
|
||||||
public function addWarning(Test $test, Warning $e, float $time): void
|
public function addWarning(Test $test, Warning $e, float $time): void
|
||||||
{
|
{
|
||||||
if (!TeamCity::isPestTest($test)) {
|
$this->phpunitTeamCity->addWarning($test, $e, $time);
|
||||||
$this->phpunitTeamCity->addWarning($test, $e, $time);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->printEvent(
|
|
||||||
self::TEST_FAILED, [
|
|
||||||
self::NAME => $test->getName(),
|
|
||||||
'message' => $e->getMessage(),
|
|
||||||
'details' => $e->getTraceAsString(),
|
|
||||||
self::DURATION => self::toMilliseconds($time),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addFailure(Test $test, AssertionFailedError $e, float $time): void
|
public function addFailure(Test $test, AssertionFailedError $e, float $time): void
|
||||||
|
|||||||
@ -9,6 +9,7 @@ use Pest\PendingObjects\BeforeEachCall;
|
|||||||
use Pest\PendingObjects\TestCall;
|
use Pest\PendingObjects\TestCall;
|
||||||
use Pest\PendingObjects\UsesCall;
|
use Pest\PendingObjects\UsesCall;
|
||||||
use Pest\Support\Backtrace;
|
use Pest\Support\Backtrace;
|
||||||
|
use Pest\Support\Extendable;
|
||||||
use Pest\Support\HigherOrderTapProxy;
|
use Pest\Support\HigherOrderTapProxy;
|
||||||
use Pest\TestSuite;
|
use Pest\TestSuite;
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
@ -111,9 +112,13 @@ function afterAll(Closure $closure = null): void
|
|||||||
*
|
*
|
||||||
* @param mixed $value the Value
|
* @param mixed $value the Value
|
||||||
*
|
*
|
||||||
* @return Expectation
|
* @return Expectation|Extendable
|
||||||
*/
|
*/
|
||||||
function expect($value)
|
function expect($value = null)
|
||||||
{
|
{
|
||||||
|
if (func_num_args() === 0) {
|
||||||
|
return new Extendable(Expectation::class);
|
||||||
|
}
|
||||||
|
|
||||||
return test()->expect($value);
|
return test()->expect($value);
|
||||||
}
|
}
|
||||||
|
|||||||
5
tests/.snapshots/help-command.txt
Normal file
5
tests/.snapshots/help-command.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
Pest Options:
|
||||||
|
--init Initialise a standard Pest configuration
|
||||||
|
--coverage Enable coverage and output to standard output
|
||||||
|
--min=<N> Set the minimum required coverage percentage (<N>), and fail if not met
|
||||||
|
--group=<name> Only runs tests from the specified group(s)
|
||||||
@ -2,6 +2,12 @@
|
|||||||
PASS Tests\CustomTestCase\ExecutedTest
|
PASS Tests\CustomTestCase\ExecutedTest
|
||||||
✓ that gets executed
|
✓ that gets executed
|
||||||
|
|
||||||
|
PASS Tests\Expect\extend
|
||||||
|
✓ it macros true is true
|
||||||
|
✓ it macros false is not true
|
||||||
|
✓ it macros true is true with argument
|
||||||
|
✓ it macros false is not true with argument
|
||||||
|
|
||||||
PASS Tests\Expect\not
|
PASS Tests\Expect\not
|
||||||
✓ not property calls
|
✓ not property calls
|
||||||
|
|
||||||
@ -200,6 +206,11 @@
|
|||||||
PASS Tests\Expect\toMatch
|
PASS Tests\Expect\toMatch
|
||||||
✓ pass
|
✓ pass
|
||||||
✓ failures
|
✓ failures
|
||||||
|
✓ not failures
|
||||||
|
|
||||||
|
PASS Tests\Expect\toMatchArray
|
||||||
|
✓ pass
|
||||||
|
✓ failures
|
||||||
✓ not failures
|
✓ not failures
|
||||||
|
|
||||||
PASS Tests\Expect\toMatchConstraint
|
PASS Tests\Expect\toMatchConstraint
|
||||||
@ -255,6 +266,9 @@
|
|||||||
✓ eager wrapped registered datasets with (1)
|
✓ eager wrapped registered datasets with (1)
|
||||||
✓ eager wrapped registered datasets with (2)
|
✓ eager wrapped registered datasets with (2)
|
||||||
✓ eager registered wrapped datasets did the job right
|
✓ eager registered wrapped datasets did the job right
|
||||||
|
✓ named datasets with data set "one" (1)
|
||||||
|
✓ named datasets with data set "two" (2)
|
||||||
|
✓ named datasets did the job right
|
||||||
✓ lazy named datasets with (Bar Object (...))
|
✓ lazy named datasets with (Bar Object (...))
|
||||||
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1
|
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1
|
||||||
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #2
|
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #2
|
||||||
@ -345,6 +359,12 @@
|
|||||||
✓ it throws exception when `process isolation` is true
|
✓ it throws exception when `process isolation` is true
|
||||||
✓ it do not throws exception when `process isolation` is false
|
✓ it do not throws exception when `process isolation` is false
|
||||||
|
|
||||||
|
PASS Tests\Unit\Console\Help
|
||||||
|
✓ it outputs the help information when --help is used
|
||||||
|
|
||||||
|
PASS Tests\Unit\Datasets
|
||||||
|
✓ it show the names of named datasets in their description
|
||||||
|
|
||||||
PASS Tests\Unit\Plugins\Version
|
PASS Tests\Unit\Plugins\Version
|
||||||
✓ it outputs the version when --version is used
|
✓ it outputs the version when --version is used
|
||||||
✓ it do not outputs version when --version is not used
|
✓ it do not outputs version when --version is not used
|
||||||
@ -368,6 +388,9 @@
|
|||||||
PASS Tests\Unit\TestSuite
|
PASS Tests\Unit\TestSuite
|
||||||
✓ it does not allow to add the same test description twice
|
✓ it does not allow to add the same test description twice
|
||||||
|
|
||||||
|
PASS Tests\Visual\Help
|
||||||
|
✓ visual snapshot of help command output
|
||||||
|
|
||||||
PASS Tests\Visual\SingleTestOrDirectory
|
PASS Tests\Visual\SingleTestOrDirectory
|
||||||
✓ allows to run a single test
|
✓ allows to run a single test
|
||||||
✓ allows to run a directory
|
✓ allows to run a directory
|
||||||
@ -380,10 +403,12 @@
|
|||||||
PASS Tests\Features\Depends
|
PASS Tests\Features\Depends
|
||||||
✓ first
|
✓ first
|
||||||
✓ second
|
✓ second
|
||||||
|
✓ it asserts true is true
|
||||||
✓ depends
|
✓ depends
|
||||||
✓ depends with ...params
|
✓ depends with ...params
|
||||||
✓ depends with defined arguments
|
✓ depends with defined arguments
|
||||||
✓ depends run test only once
|
✓ depends run test only once
|
||||||
|
✓ depends works with the correct test name
|
||||||
|
|
||||||
Tests: 7 skipped, 227 passed
|
Tests: 7 skipped, 242 passed
|
||||||
|
|
||||||
29
tests/Expect/extend.php
Normal file
29
tests/Expect/extend.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
expect()->extend('toBeAMacroExpectation', function () {
|
||||||
|
$this->toBeTrue();
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
});
|
||||||
|
|
||||||
|
expect()->extend('toBeAMacroExpectationWithArguments', function (bool $value) {
|
||||||
|
$this->toBe($value);
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('macros true is true', function () {
|
||||||
|
expect(true)->toBeAMacroExpectation();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('macros false is not true', function () {
|
||||||
|
expect(false)->not->toBeAMacroExpectation();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('macros true is true with argument', function () {
|
||||||
|
expect(true)->toBeAMacroExpectationWithArguments(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('macros false is not true with argument', function () {
|
||||||
|
expect(false)->not->toBeAMacroExpectationWithArguments(true);
|
||||||
|
});
|
||||||
31
tests/Expect/toMatchArray.php
Normal file
31
tests/Expect/toMatchArray.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use PHPUnit\Framework\ExpectationFailedException;
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
$this->user = [
|
||||||
|
'id' => 1,
|
||||||
|
'name' => 'Nuno',
|
||||||
|
'email' => 'enunomaduro@gmail.com',
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
test('pass', function () {
|
||||||
|
expect($this->user)->toMatchArray([
|
||||||
|
'name' => 'Nuno',
|
||||||
|
'email' => 'enunomaduro@gmail.com',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('failures', function () {
|
||||||
|
expect($this->user)->toMatchArray([
|
||||||
|
'name' => 'Not the same name',
|
||||||
|
'email' => 'enunomaduro@gmail.com',
|
||||||
|
]);
|
||||||
|
})->throws(ExpectationFailedException::class);
|
||||||
|
|
||||||
|
test('not failures', function () {
|
||||||
|
expect($this->user)->not->toMatchArray([
|
||||||
|
'id' => 1,
|
||||||
|
]);
|
||||||
|
})->throws(ExpectationFailedException::class);
|
||||||
@ -95,6 +95,18 @@ test('eager registered wrapped datasets did the job right', function () use ($st
|
|||||||
expect($state->text)->toBe('1212121212');
|
expect($state->text)->toBe('1212121212');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('named datasets', function ($text) use ($state, $datasets) {
|
||||||
|
$state->text .= $text;
|
||||||
|
expect($datasets)->toContain([$text]);
|
||||||
|
})->with([
|
||||||
|
'one' => [1],
|
||||||
|
'two' => [2],
|
||||||
|
]);
|
||||||
|
|
||||||
|
test('named datasets did the job right', function () use ($state) {
|
||||||
|
expect($state->text)->toBe('121212121212');
|
||||||
|
});
|
||||||
|
|
||||||
class Bar
|
class Bar
|
||||||
{
|
{
|
||||||
public $name = 1;
|
public $name = 1;
|
||||||
|
|||||||
@ -32,3 +32,7 @@ test('depends with defined arguments', function (string $first, string $second)
|
|||||||
test('depends run test only once', function () use (&$runCounter) {
|
test('depends run test only once', function () use (&$runCounter) {
|
||||||
expect($runCounter)->toBe(2);
|
expect($runCounter)->toBe(2);
|
||||||
})->depends('first', 'second');
|
})->depends('first', 'second');
|
||||||
|
|
||||||
|
// Regression tests. See https://github.com/pestphp/pest/pull/216
|
||||||
|
it('asserts true is true')->assertTrue(true);
|
||||||
|
test('depends works with the correct test name')->assertTrue(true)->depends('it asserts true is true');
|
||||||
|
|||||||
12
tests/Unit/Console/Help.php
Normal file
12
tests/Unit/Console/Help.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Pest\Console\Help;
|
||||||
|
use Symfony\Component\Console\Output\BufferedOutput;
|
||||||
|
|
||||||
|
it('outputs the help information when --help is used', function () {
|
||||||
|
$output = new BufferedOutput();
|
||||||
|
$plugin = new Help($output);
|
||||||
|
|
||||||
|
$plugin();
|
||||||
|
expect($output->fetch())->toContain('Pest Options:');
|
||||||
|
});
|
||||||
13
tests/Unit/Datasets.php
Normal file
13
tests/Unit/Datasets.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Pest\Datasets;
|
||||||
|
|
||||||
|
it('show the names of named datasets in their description', function () {
|
||||||
|
$descriptions = array_keys(Datasets::resolve('test description', [
|
||||||
|
'one' => [1],
|
||||||
|
'two' => [[2]],
|
||||||
|
]));
|
||||||
|
|
||||||
|
expect($descriptions[0])->toBe('test description with data set "one" (1)');
|
||||||
|
expect($descriptions[1])->toBe('test description with data set "two" (array(2))');
|
||||||
|
});
|
||||||
27
tests/Visual/Help.php
Normal file
27
tests/Visual/Help.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Pest\Console\Help;
|
||||||
|
use Symfony\Component\Console\Output\BufferedOutput;
|
||||||
|
|
||||||
|
test('visual snapshot of help command output', function () {
|
||||||
|
$snapshot = __DIR__ . '/../.snapshots/help-command.txt';
|
||||||
|
|
||||||
|
if (getenv('REBUILD_SNAPSHOTS')) {
|
||||||
|
$outputBuffer = new BufferedOutput();
|
||||||
|
$plugin = new Help($outputBuffer);
|
||||||
|
|
||||||
|
$plugin();
|
||||||
|
|
||||||
|
file_put_contents($snapshot, $outputBuffer->fetch());
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = function () {
|
||||||
|
$process = (new Symfony\Component\Process\Process(['php', 'bin/pest', '--help']));
|
||||||
|
|
||||||
|
$process->run();
|
||||||
|
|
||||||
|
return preg_replace('#\\x1b[[][^A-Za-z]*[A-Za-z]#', '', $process->getOutput());
|
||||||
|
};
|
||||||
|
|
||||||
|
expect($output())->toContain(file_get_contents($snapshot));
|
||||||
|
})->skip(PHP_OS_FAMILY === 'Windows');
|
||||||
Reference in New Issue
Block a user