Compare commits

..

11 Commits

Author SHA1 Message Date
nuno maduro d9d46c73f8 chore: stores statically the result 2026-04-09 21:36:49 +01:00
nuno maduro e44c554a0b chore: bumps dependencies 2026-04-06 21:57:05 +01:00
nuno maduro 9797a71dbc feat(ai): allow temporary namesapce 2026-04-03 14:43:28 +01:00
nuno maduro c1a54df233 feat: --ai work in progress 2026-04-03 14:04:20 +01:00
nuno maduro ce05ee9aad release: v4.4.4 2026-04-03 12:00:04 +01:00
nuno maduro 3d2ebdb273 bump: dependencies 2026-04-03 11:59:54 +01:00
nuno maduro f47b74445b Merge pull request #1657 from morpheus7CS/pint-formatting-rules-applied-to-stubs 2026-04-02 13:04:00 +01:00
Gal Jakic (We Wow Web) 6c42e7f4ea Laravel Pint default formatting applied to Pest-php.stub 2026-04-01 16:48:14 +02:00
nuno maduro a087555383 bump: dependencies 2026-03-26 14:30:03 +00:00
nuno maduro e6ab897594 release: v4.4.3 2026-03-21 13:14:39 +00:00
nuno maduro a753b41409 chore: bumps phpunit 2026-03-21 13:14:35 +00:00
11 changed files with 74 additions and 13 deletions
+7 -7
View File
@@ -18,19 +18,19 @@
],
"require": {
"php": "^8.3.0",
"brianium/paratest": "^7.19.0",
"nunomaduro/collision": "^8.9.1",
"brianium/paratest": "^7.20.0",
"nunomaduro/collision": "^8.9.3",
"nunomaduro/termwind": "^2.4.0",
"pestphp/pest-plugin": "^4.0.0",
"pestphp/pest-plugin-arch": "^4.0.0",
"pestphp/pest-plugin-mutate": "^4.0.1",
"pestphp/pest-plugin-profanity": "^4.2.1",
"phpunit/phpunit": "^12.5.12",
"symfony/process": "^7.4.5|^8.0.5"
"phpunit/phpunit": "^12.5.16",
"symfony/process": "^7.4.8|^8.0.8"
},
"conflict": {
"filp/whoops": "<2.18.3",
"phpunit/phpunit": ">12.5.12",
"phpunit/phpunit": ">12.5.16",
"sebastian/exporter": "<7.0.0",
"webmozart/assert": "<1.11.0"
},
@@ -57,8 +57,8 @@
"require-dev": {
"pestphp/pest-dev-tools": "^4.1.0",
"pestphp/pest-plugin-browser": "^4.3.0",
"pestphp/pest-plugin-type-coverage": "^4.0.3",
"psy/psysh": "^0.12.21"
"pestphp/pest-plugin-type-coverage": "^4.0.4",
"psy/psysh": "^0.12.22"
},
"minimum-stability": "dev",
"prefer-stable": true,
+6 -1
View File
@@ -59,6 +59,11 @@ final class TestCaseFactory
Concerns\Expectable::class,
];
/**
* The namespace for the test case, overrides the path-based namespace when set.
*/
public ?string $namespace = null;
/**
* Creates a new Factory instance.
*/
@@ -127,7 +132,7 @@ final class TestCaseFactory
$partsFQN = explode('\\', $classFQN);
$className = array_pop($partsFQN);
$namespace = implode('\\', $partsFQN);
$namespace = $this->namespace ?? implode('\\', $partsFQN);
$baseClass = sprintf('\%s', $this->class);
if (trim($className) === '') {
+1 -1
View File
@@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
return '4.4.2';
return '4.4.4';
}
function testDirectory(string $file = ''): string
+27
View File
@@ -56,4 +56,31 @@ trait HandleArguments
return array_values(array_flip($arguments));
}
/**
* Pops the given argument and its value from the arguments, returning the value.
*
* @param array<int, string> $arguments
*/
public function popArgumentValue(string $argument, array &$arguments): ?string
{
foreach ($arguments as $key => $value) {
if (str_contains($value, "$argument=")) {
unset($arguments[$key]);
$arguments = array_values($arguments);
return substr($value, strlen($argument) + 1);
}
if ($value === $argument && isset($arguments[$key + 1])) {
$result = $arguments[$key + 1];
unset($arguments[$key], $arguments[$key + 1]);
$arguments = array_values($arguments);
return $result;
}
}
return null;
}
}
+7
View File
@@ -107,6 +107,13 @@ final readonly class Help implements HandlesArguments
'desc' => 'Initialise a standard Pest configuration',
]], ...$content['Configuration']];
$content['AI'] = [
[
'arg' => '--ai',
'desc' => 'Run a code snippet as a fully scaffolded test for AI verification',
],
];
$content['Execution'] = [...[
[
'arg' => '--parallel',
@@ -51,6 +51,11 @@ final class WrapperRunner implements RunnerInterface
/**
* The time to sleep between cycles.
*/
/**
* The merged test result from the parallel run.
*/
public static ?TestResult $result = null;
private const int CYCLE_SLEEP = 10000;
/**
@@ -386,6 +391,8 @@ final class WrapperRunner implements RunnerInterface
$testResultSum->numberOfIssuesIgnoredByBaseline(),
);
self::$result = $testResultSum;
if ($this->options->configuration->cacheResult()) {
$resultCacheSum = new DefaultResultCache($this->options->configuration->testResultCacheFile());
foreach ($this->resultCacheFiles as $resultCacheFile) {
+10
View File
@@ -113,6 +113,16 @@ final class TestRepository
$this->testCaseMethodFilters[] = $filter;
}
/**
* Gets the class and traits configured for the given directory path.
*
* @return array<int, string>
*/
public function getUsesForPath(string $path): array
{
return $this->uses[$path][0] ?? [];
}
/**
* Gets the test case factory from the given filename.
*/
+1
View File
@@ -26,6 +26,7 @@ final class ExceptionTrace
return $closure();
} catch (Throwable $throwable) {
if (Str::startsWith($message = $throwable->getMessage(), self::UNDEFINED_METHOD)) {
// @phpstan-ignore-next-line
$class = preg_match('/^Call to undefined method ([^:]+)::/', $message, $matches) === false ? null : $matches[1];
$message = str_replace(self::UNDEFINED_METHOD, 'Call to undefined method ', $message);
+2 -1
View File
@@ -1,5 +1,6 @@
<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
/*
@@ -14,7 +15,7 @@ use Tests\TestCase;
*/
pest()->extend(TestCase::class)
// ->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
// ->use(RefreshDatabase::class)
->in('Feature');
/*
@@ -1,5 +1,5 @@
Pest Testing Framework 4.4.2.
Pest Testing Framework 4.4.4.
USAGE: pest <file> [options]
@@ -92,7 +92,7 @@
--random-order-seed [N] Use the specified random seed when running tests in random order
REPORTING OPTIONS:
--colors [flag] ......... Use colors in output ("never", "auto" or "always")
--colors=[flag] ......... Use colors in output ("never", "auto" or "always")
--columns [n] ................. Number of columns to use for progress output
--columns max ............ Use maximum number of columns for progress output
--stderr ................................. Write to STDERR instead of STDOUT
@@ -147,6 +147,9 @@
--disable-coverage-ignore ...... Disable metadata for ignoring code coverage
--no-coverage Ignore code coverage reporting configured in the XML configuration file
AI OPTIONS:
--ai ..... Run a code snippet as a fully scaffolded test for AI verification
MUTATION TESTING OPTIONS:
--mutate .... Runs mutation testing, to understand the quality of your tests
--mutate --parallel ...................... Runs mutation testing in parallel
@@ -1,3 +1,3 @@
Pest Testing Framework 4.4.2.
Pest Testing Framework 4.4.4.