mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9842e1051d | |||
| d39e4f15fe | |||
| 1a05df14d0 | |||
| 5c0df87f52 | |||
| ec6a81735a | |||
| 2ea37f3424 | |||
| 2e4206cb97 | |||
| 72b3cdaab4 | |||
| 9744b9848e | |||
| e1143d2cfc | |||
| 5861b0498a | |||
| f6d9aa51bd | |||
| 518035514e | |||
| 97dbda92e6 | |||
| 4520fe918a |
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,16 @@
|
|||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
## [v2.5.2 (2023-04-19)](https://github.com/pestphp/pest/compare/v2.5.1...v2.5.2)
|
||||||
|
|
||||||
|
### Chore
|
||||||
|
- Removes `myclabs/php-enuma` dependency ([1a05df1](https://github.com/pestphp/pest/commit/1a05df14d0ce7d12583df26ff716807db6f81f13))
|
||||||
|
|
||||||
|
## [v2.5.1 (2023-04-18)](https://github.com/pestphp/pest/compare/v2.5.0...v2.5.1)
|
||||||
|
|
||||||
|
### Chore
|
||||||
|
- Bumps PHPUnit to `^10.1.1` ([ec6a817](https://github.com/pestphp/pest/commit/ec6a81735af19f5463d24545df97535d77697ec6))
|
||||||
|
|
||||||
## [v2.5.0 (2023-04-14)](https://github.com/pestphp/pest/compare/v2.4.0...v2.5.0)
|
## [v2.5.0 (2023-04-14)](https://github.com/pestphp/pest/compare/v2.4.0...v2.5.0)
|
||||||
|
|
||||||
### Chore
|
### Chore
|
||||||
|
|||||||
@ -19,15 +19,15 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1.0",
|
"php": "^8.1.0",
|
||||||
"brianium/paratest": "^7.1.3",
|
"brianium/paratest": "^7.1.3",
|
||||||
"nunomaduro/collision": "^7.4.0",
|
"nunomaduro/collision": "^7.5.2",
|
||||||
"nunomaduro/termwind": "^1.15.1",
|
"nunomaduro/termwind": "^1.15.1",
|
||||||
"pestphp/pest-plugin": "^2.0.1",
|
"pestphp/pest-plugin": "^2.0.1",
|
||||||
"pestphp/pest-plugin-arch": "^2.1.1",
|
"pestphp/pest-plugin-arch": "^2.1.2",
|
||||||
"phpunit/phpunit": "^10.1.0"
|
"phpunit/phpunit": "^10.1.2"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"webmozart/assert": "<1.11.0",
|
"webmozart/assert": "<1.11.0",
|
||||||
"phpunit/phpunit": ">10.1.0"
|
"phpunit/phpunit": ">10.1.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
@ -14,7 +14,17 @@ final class TestDox implements AddsAnnotations
|
|||||||
*/
|
*/
|
||||||
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
|
public function __invoke(TestCaseMethodFactory $method, array $annotations): array
|
||||||
{
|
{
|
||||||
$annotations[] = "@testdox $method->description";
|
/*
|
||||||
|
* escapes docblock according to
|
||||||
|
* https://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.desc
|
||||||
|
*
|
||||||
|
* note: '@' escaping is not needed as it cannot be the first character of the line (it always starts with @testdox
|
||||||
|
*/
|
||||||
|
|
||||||
|
assert($method->description !== null);
|
||||||
|
$methodDescription = str_replace('*/', '{@*}', $method->description);
|
||||||
|
|
||||||
|
$annotations[] = "@testdox $methodDescription";
|
||||||
|
|
||||||
return $annotations;
|
return $annotations;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '2.4.0';
|
return '2.5.3';
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDirectory(string $file = ''): string
|
function testDirectory(string $file = ''): string
|
||||||
|
|||||||
@ -109,20 +109,16 @@ final class Help implements HandlesArguments
|
|||||||
],
|
],
|
||||||
], ...$content['Execution']];
|
], ...$content['Execution']];
|
||||||
|
|
||||||
$content['Selection'] = array_merge([
|
$content['Selection'] = [[
|
||||||
[
|
'arg' => '--bail',
|
||||||
'arg' => '--bail',
|
'desc' => 'Stop execution upon first not-passed test',
|
||||||
'desc' => 'Stop execution upon first not-passed test',
|
], [
|
||||||
],
|
'arg' => '--todos',
|
||||||
[
|
'desc' => 'Output to standard output the list of todos',
|
||||||
'arg' => '--todos',
|
], [
|
||||||
'desc' => 'Output to standard output the list of todos',
|
'arg' => '--retry',
|
||||||
],
|
'desc' => 'Run non-passing tests first and stop execution upon first error or failure',
|
||||||
[
|
], ...$content['Selection']];
|
||||||
'arg' => '--retry',
|
|
||||||
'desc' => 'Run non-passing tests first and stop execution upon first error or failure',
|
|
||||||
],
|
|
||||||
], $content['Selection']);
|
|
||||||
|
|
||||||
$content['Reporting'] = [...$content['Reporting'], ...[
|
$content['Reporting'] = [...$content['Reporting'], ...[
|
||||||
[
|
[
|
||||||
@ -131,16 +127,13 @@ final class Help implements HandlesArguments
|
|||||||
],
|
],
|
||||||
]];
|
]];
|
||||||
|
|
||||||
$content['Code Coverage'] = array_merge([
|
$content['Code Coverage'] = [[
|
||||||
[
|
'arg' => '--coverage ',
|
||||||
'arg' => '--coverage ',
|
'desc' => 'Generate code coverage report and output to standard output',
|
||||||
'desc' => 'Generate code coverage report and output to standard output',
|
], [
|
||||||
],
|
'arg' => '--coverage --min',
|
||||||
[
|
'desc' => 'Set the minimum required coverage percentage, and fail if not met',
|
||||||
'arg' => '--coverage --min',
|
], ...$content['Code Coverage']];
|
||||||
'desc' => 'Set the minimum required coverage percentage, and fail if not met',
|
|
||||||
],
|
|
||||||
], $content['Code Coverage']);
|
|
||||||
|
|
||||||
$content['Profiling'] = [
|
$content['Profiling'] = [
|
||||||
[
|
[
|
||||||
|
|||||||
@ -26,11 +26,11 @@ final class Init implements HandlesArguments
|
|||||||
* The files that will be created.
|
* The files that will be created.
|
||||||
*/
|
*/
|
||||||
private const STUBS = [
|
private const STUBS = [
|
||||||
'phpunit.xml' => 'phpunit.xml',
|
'phpunit.xml.stub' => 'phpunit.xml',
|
||||||
'Pest.php' => 'tests/Pest.php',
|
'Pest.php.stub' => 'tests/Pest.php',
|
||||||
'TestCase.php' => 'tests/TestCase.php',
|
'TestCase.php.stub' => 'tests/TestCase.php',
|
||||||
'Unit/ExampleTest.php' => 'tests/Unit/ExampleTest.php',
|
'Unit/ExampleTest.php.stub' => 'tests/Unit/ExampleTest.php',
|
||||||
'Feature/ExampleTest.php' => 'tests/Feature/ExampleTest.php',
|
'Feature/ExampleTest.php.stub' => 'tests/Feature/ExampleTest.php',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -42,6 +42,14 @@ final class Coverage
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($runtime->hasPCOV()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($runtime->hasPHPDBGCodeCoverage()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $runtime->hasXdebug()) {
|
if (! $runtime->hasXdebug()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Pest Testing Framework 2.4.0.
|
Pest Testing Framework 2.5.3.
|
||||||
|
|
||||||
USAGE: pest <file> [options]
|
USAGE: pest <file> [options]
|
||||||
|
|
||||||
|
|||||||
@ -152,7 +152,7 @@
|
|||||||
✓ it uses correct parent class
|
✓ it uses correct parent class
|
||||||
|
|
||||||
DEPR Tests\Features\Deprecated
|
DEPR Tests\Features\Deprecated
|
||||||
! deprecated → str_contains(): Passing null to parameter #2 ($needle) of type string is deprecated // tests/Features/Deprecated.php:6
|
! deprecated → str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated // tests/Features/Deprecated.php:6
|
||||||
✓ user deprecated
|
✓ user deprecated
|
||||||
|
|
||||||
PASS Tests\Features\Exceptions
|
PASS Tests\Features\Exceptions
|
||||||
@ -977,6 +977,7 @@
|
|||||||
✓ Німеччина
|
✓ Німеччина
|
||||||
✓ Nam Định
|
✓ Nam Định
|
||||||
✓ 呼和浩特
|
✓ 呼和浩特
|
||||||
|
✓ test /** with comment */ should do
|
||||||
|
|
||||||
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
|
||||||
@ -1016,4 +1017,4 @@
|
|||||||
PASS Tests\Visual\Version
|
PASS Tests\Visual\Version
|
||||||
✓ visual snapshot of help command output
|
✓ visual snapshot of help command output
|
||||||
|
|
||||||
Tests: 1 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 710 passed (1717 assertions)
|
Tests: 1 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 14 skipped, 711 passed (1719 assertions)
|
||||||
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Pest Testing Framework 2.4.0.
|
Pest Testing Framework 2.5.3.
|
||||||
|
|
||||||
|
|||||||
@ -85,16 +85,16 @@ it('works with higher order tests')
|
|||||||
it('can use the scoped method to lock into the given level for expectations', function () {
|
it('can use the scoped method to lock into the given level for expectations', function () {
|
||||||
expect(new HasMethods())
|
expect(new HasMethods())
|
||||||
->attributes()->scoped(fn ($attributes) => $attributes
|
->attributes()->scoped(fn ($attributes) => $attributes
|
||||||
->name->toBe('Has Methods')
|
->name->toBe('Has Methods')
|
||||||
->quantity->toBe(20)
|
->quantity->toBe(20)
|
||||||
)
|
)
|
||||||
->name()->toBeString()->toBe('Has Methods')
|
->name()->toBeString()->toBe('Has Methods')
|
||||||
->newInstance()->newInstance()->scoped(fn ($instance) => $instance
|
->newInstance()->newInstance()->scoped(fn ($instance) => $instance
|
||||||
->name()->toBe('Has Methods')
|
->name()->toBe('Has Methods')
|
||||||
->quantity()->toBe(20)
|
->quantity()->toBe(20)
|
||||||
->attributes()->scoped(fn ($attributes) => $attributes
|
->attributes()->scoped(fn ($attributes) => $attributes
|
||||||
->name->toBe('Has Methods')
|
->name->toBe('Has Methods')
|
||||||
->quantity->toBe(20)
|
->quantity->toBe(20)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -171,19 +171,19 @@ test('pipe works with negated expectation', function () use ($state) {
|
|||||||
$state->reset();
|
$state->reset();
|
||||||
|
|
||||||
expect($char)->not->toBe(new Char('B'))
|
expect($char)->not->toBe(new Char('B'))
|
||||||
->and($state)
|
->and($state)
|
||||||
->runCount->toMatchArray([
|
->runCount->toMatchArray([
|
||||||
'char' => 1,
|
'char' => 1,
|
||||||
'number' => 0,
|
'number' => 0,
|
||||||
'wildcard' => 0,
|
'wildcard' => 0,
|
||||||
'symbol' => 0,
|
'symbol' => 0,
|
||||||
])
|
])
|
||||||
->appliedCount->toMatchArray([
|
->appliedCount->toMatchArray([
|
||||||
'char' => 1,
|
'char' => 1,
|
||||||
'number' => 0,
|
'number' => 0,
|
||||||
'wildcard' => 0,
|
'wildcard' => 0,
|
||||||
'symbol' => 0,
|
'symbol' => 0,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('interceptor is applied', function () use ($state) {
|
test('interceptor is applied', function () use ($state) {
|
||||||
|
|||||||
@ -61,6 +61,7 @@ $names = [
|
|||||||
'Німеччина' => '__pest_evaluable_Німеччина',
|
'Німеччина' => '__pest_evaluable_Німеччина',
|
||||||
'Nam Định' => '__pest_evaluable_Nam_Định',
|
'Nam Định' => '__pest_evaluable_Nam_Định',
|
||||||
'呼和浩特' => '__pest_evaluable_呼和浩特',
|
'呼和浩特' => '__pest_evaluable_呼和浩特',
|
||||||
|
'test /** with comment */ should do' => '__pest_evaluable_test_____with_comment____should_do',
|
||||||
];
|
];
|
||||||
|
|
||||||
foreach ($names as $name => $methodName) {
|
foreach ($names as $name => $methodName) {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ $run = function () {
|
|||||||
|
|
||||||
test('parallel', function () use ($run) {
|
test('parallel', function () use ($run) {
|
||||||
expect($run('--exclude-group=integration'))
|
expect($run('--exclude-group=integration'))
|
||||||
->toContain('Tests: 1 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 698 passed (1702 assertions)')
|
->toContain('Tests: 1 deprecated, 3 warnings, 4 incomplete, 1 notice, 4 todos, 11 skipped, 699 passed (1704 assertions)')
|
||||||
->toContain('Parallel: 3 processes');
|
->toContain('Parallel: 3 processes');
|
||||||
})->skipOnWindows();
|
})->skipOnWindows();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user