mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 83f8de17c8 | |||
| c8d3e1a9fa | |||
| f7705fe1c1 | |||
| cf23dfa477 | |||
| ab4787c667 | |||
| bd6b166a62 | |||
| 17340947b3 | |||
| f235d84d95 | |||
| 3c0d780696 | |||
| 16768fca9f | |||
| 95ec0a82b2 | |||
| 0a680dd06e | |||
| 152892cc38 | |||
| 9aad417fb2 | |||
| b58e0cba66 | |||
| 74864c60e1 |
@ -18,7 +18,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.1.0",
|
||||
"brianium/paratest": "^7.3.0",
|
||||
"brianium/paratest": "^7.3.1",
|
||||
"nunomaduro/collision": "^7.10.0|^8.0.0",
|
||||
"nunomaduro/termwind": "^1.15.1|^2.0.0",
|
||||
"pestphp/pest-plugin": "^2.1.1",
|
||||
@ -52,7 +52,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"pestphp/pest-dev-tools": "^2.16.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^2.4.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^2.5.0",
|
||||
"symfony/process": "^6.3.4"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
@ -109,6 +109,11 @@
|
||||
"Pest\\Plugins\\Version",
|
||||
"Pest\\Plugins\\Parallel"
|
||||
]
|
||||
},
|
||||
"phpstan": {
|
||||
"includes": [
|
||||
"extension.neon"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
extension.neon
Normal file
4
extension.neon
Normal file
@ -0,0 +1,4 @@
|
||||
parameters:
|
||||
universalObjectCratesClasses:
|
||||
- Pest\Support\HigherOrderTapProxy
|
||||
- Pest\Expectation
|
||||
@ -193,6 +193,7 @@ trait Testable
|
||||
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
|
||||
|
||||
$description = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
|
||||
$description = htmlspecialchars(html_entity_decode($description), ENT_NOQUOTES);
|
||||
|
||||
if ($method->repetitions > 1) {
|
||||
$matches = [];
|
||||
|
||||
@ -233,6 +233,30 @@ final class TestCall
|
||||
: $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the current test unless the given test is running on Windows.
|
||||
*/
|
||||
public function onlyOnWindows(): self
|
||||
{
|
||||
return $this->skipOnMac()->skipOnLinux();
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the current test unless the given test is running on Mac.
|
||||
*/
|
||||
public function onlyOnMac(): self
|
||||
{
|
||||
return $this->skipOnWindows()->skipOnLinux();
|
||||
}
|
||||
|
||||
/**
|
||||
* Skips the current test unless the given test is running on Linux.
|
||||
*/
|
||||
public function onlyOnLinux(): self
|
||||
{
|
||||
return $this->skipOnWindows()->skipOnMac();
|
||||
}
|
||||
|
||||
/**
|
||||
* Repeats the current test the given number of times.
|
||||
*/
|
||||
|
||||
@ -6,7 +6,7 @@ namespace Pest;
|
||||
|
||||
function version(): string
|
||||
{
|
||||
return '2.24.1';
|
||||
return '2.25.0';
|
||||
}
|
||||
|
||||
function testDirectory(string $file = ''): string
|
||||
|
||||
@ -54,8 +54,8 @@ final class Result
|
||||
$returnCode = self::FAILURE_EXIT;
|
||||
}
|
||||
|
||||
$warnings = $result->numberOfTestsWithTestTriggeredPhpunitWarningEvents() +
|
||||
+count($result->warnings())
|
||||
$warnings = $result->numberOfTestsWithTestTriggeredPhpunitWarningEvents()
|
||||
+ count($result->warnings())
|
||||
+ count($result->phpWarnings());
|
||||
|
||||
if ($configuration->failOnWarning() && $warnings > 0) {
|
||||
|
||||
@ -190,7 +190,7 @@ final class Reflection
|
||||
}
|
||||
|
||||
$arguments[$parameter->getName()] = implode('|', array_map(
|
||||
static fn (ReflectionNamedType $type): string => $type->getName(),
|
||||
static fn (ReflectionNamedType $type): string => $type->getName(), // @phpstan-ignore-line
|
||||
($types instanceof ReflectionNamedType)
|
||||
? [$types] // NOTE: normalize as list of to handle unions
|
||||
: $types->getTypes(),
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
|
||||
Pest Testing Framework 2.24.1.
|
||||
Pest Testing Framework 2.25.0.
|
||||
|
||||
USAGE: pest <file> [options]
|
||||
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
|
||||
Pest Testing Framework 2.24.1.
|
||||
Pest Testing Framework 2.25.0.
|
||||
|
||||
|
||||
@ -1194,6 +1194,7 @@
|
||||
✓ it show the correct description for mixed named and not-named datasets
|
||||
✓ it shows the correct description for long texts with newlines
|
||||
✓ it shows the correct description for arrays with many elements
|
||||
✓ it shows the correct description of datasets with html
|
||||
|
||||
PASS Tests\Unit\Expectations\OppositeExpectation
|
||||
✓ it throw expectation failed exception with string argument
|
||||
@ -1352,4 +1353,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 962 passed (2280 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 963 passed (2281 assertions)
|
||||
@ -99,3 +99,13 @@ it('shows the correct description for arrays with many elements', function () {
|
||||
|
||||
expect($descriptions[0])->toBe('([1, 2, 3, …])');
|
||||
});
|
||||
|
||||
it('shows the correct description of datasets with html', function () {
|
||||
$descriptions = array_keys(DatasetsRepository::resolve([
|
||||
[
|
||||
'<div class="flex items-center"></div>',
|
||||
],
|
||||
], __FILE__));
|
||||
|
||||
expect($descriptions[0])->toBe('(\'<div class="flex items-center"></div>\')');
|
||||
});
|
||||
|
||||
@ -20,7 +20,7 @@ $names = [
|
||||
'卜竹弓一十山' => '__pest_evaluable_卜竹弓一十山',
|
||||
'アゴデヸ' => '__pest_evaluable_アゴデヸ',
|
||||
'!p8VrB' => '__pest_evaluable__p8VrB',
|
||||
'&xe6VeKWF#n4' => '__pest_evaluable__xe6VeKWF_n4',
|
||||
'&xe6VeKWF#n4' => '__pest_evaluable__amp_xe6VeKWF_n4',
|
||||
'%%HurHUnw7zM!' => '__pest_evaluable___HurHUnw7zM_',
|
||||
'rundeliekend' => '__pest_evaluable_rundeliekend',
|
||||
'g%%c!Jt9$fy#Kf' => '__pest_evaluable_g__c_Jt9_fy_Kf',
|
||||
@ -33,7 +33,7 @@ $names = [
|
||||
'Каролин' => '__pest_evaluable_Каролин',
|
||||
'অ্যান্টার্কটিকা' => '__pest_evaluable_অ্যান্টার্কটিকা',
|
||||
'Frýdek-Místek"' => '__pest_evaluable_Frýdek_Místek_',
|
||||
'Allingåbro&' => '__pest_evaluable_Allingåbro_',
|
||||
'Allingåbro&' => '__pest_evaluable_Allingåbro_amp_',
|
||||
'Κεντροαφρικανική Δημοκρατία' => '__pest_evaluable_Κεντροαφρικανική_Δημοκρατία',
|
||||
'آذربایجان غربی' => '__pest_evaluable_آذربایجان_غربی',
|
||||
'זימבבואה' => '__pest_evaluable_זימבבואה',
|
||||
|
||||
@ -16,7 +16,7 @@ $run = function () {
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run('--exclude-group=integration'))
|
||||
->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 15 skipped, 951 passed (2265 assertions)')
|
||||
->toContain('Tests: 1 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 15 skipped, 952 passed (2266 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user