diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index f689e3f7..a49d36cc 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -44,7 +44,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer dependencies - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: static-php-8.4-${{ matrix.dependency-version }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 649810a3..fdc98844 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,7 +48,7 @@ jobs: run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer dependencies - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v5 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ matrix.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json', '**/composer.lock') }} diff --git a/composer.json b/composer.json index 68efda4c..a9fd8345 100644 --- a/composer.json +++ b/composer.json @@ -58,12 +58,12 @@ ] }, "require-dev": { - "mrpunyapal/peststan": "^0.2.10", + "mrpunyapal/peststan": "^0.2.11", "laravel/pao": "^1.1.1", "pestphp/pest-dev-tools": "^5.0.0", "pestphp/pest-plugin-browser": "^5.0.0", "pestphp/pest-plugin-type-coverage": "^5.0.0", - "psy/psysh": "^0.12.23" + "psy/psysh": "^0.12.24" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/rector.php b/rector.php index caec3188..a5c426f5 100644 --- a/rector.php +++ b/rector.php @@ -4,7 +4,9 @@ declare(strict_types=1); use Rector\CodingStyle\Rector\ArrowFunction\ArrowFunctionDelegatingCallToFirstClassCallableRector; use Rector\Config\RectorConfig; +use Rector\DeadCode\Rector\ClassMethod\RemoveDuplicatedReturnSelfDocblockRector; use Rector\DeadCode\Rector\ClassMethod\RemoveParentDelegatingConstructorRector; +use Rector\DeadCode\Rector\ClassMethod\RemoveUselessUnionReturnDocblockRector; use Rector\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector; use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; @@ -18,6 +20,8 @@ return RectorConfig::configure() ArrowFunctionDelegatingCallToFirstClassCallableRector::class, NarrowObjectReturnTypeRector::class, RemoveParentDelegatingConstructorRector::class, + RemoveDuplicatedReturnSelfDocblockRector::class, + RemoveUselessUnionReturnDocblockRector::class, ]) ->withPreparedSets( deadCode: true, diff --git a/src/Expectation.php b/src/Expectation.php index d98ff842..8596615b 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -130,7 +130,7 @@ final class Expectation if (getenv('PARATEST') !== false || isset($_SERVER['COLLISION_PRINTER'])) { ob_start(); var_dump($this->value, ...$arguments); - $output = (string) ob_get_clean(); + $output = ob_get_clean(); throw new ExpectationFailedException($output); } diff --git a/src/Factories/TestCaseFactory.php b/src/Factories/TestCaseFactory.php index 5c8b394d..a3a343b1 100644 --- a/src/Factories/TestCaseFactory.php +++ b/src/Factories/TestCaseFactory.php @@ -94,7 +94,8 @@ final class TestCaseFactory $filename = (string) preg_replace_callback('~^(?P[a-z]+:\\\)~i', static fn (array $match): string => strtolower($match['drive']), $filename); } - $filename = str_replace('\\\\', '\\', addslashes((string) realpath($filename))); + $realpath = (string) realpath($filename); + $filename = str_replace('\\\\', '\\', addslashes($realpath)); $rootPath = TestSuite::getInstance()->rootPath; $relativePath = str_replace($rootPath.DIRECTORY_SEPARATOR, '', $filename); @@ -149,6 +150,8 @@ final class TestCaseFactory $attributesCode = Attributes::code($this->attributes); + $filenameLiteral = var_export($realpath, true); + $methodsCode = implode('', array_map( fn (TestCaseMethodFactory $methodFactory): string => $methodFactory->buildForEvaluation(), $methods @@ -166,7 +169,7 @@ final class TestCaseFactory final class $className extends $baseClass implements $hasPrintableTestCaseClassFQN { $traitsCode - public static \$__filename = '$filename'; + public static \$__filename = $filenameLiteral; $methodsCode } diff --git a/src/Pest.php b/src/Pest.php index 198abae4..0b512ea1 100644 --- a/src/Pest.php +++ b/src/Pest.php @@ -6,7 +6,7 @@ namespace Pest; function version(): string { - return '5.0.0-rc.11'; + return '5.0.0-rc.12'; } function testDirectory(string $file = ''): string diff --git a/src/Plugins/Tia.php b/src/Plugins/Tia.php index a7d90d53..e04237e3 100644 --- a/src/Plugins/Tia.php +++ b/src/Plugins/Tia.php @@ -219,8 +219,11 @@ final class Tia implements AddsOutput, HandlesArguments, Terminable if (! $watchPatterns->isEnabled()) { return false; } + if (! $watchPatterns->isLocally()) { + return true; + } - return ! ($watchPatterns->isLocally() && self::argumentPresent('--ci', $arguments)); + return ! self::argumentPresent('--ci', $arguments); } /** diff --git a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap index fd5b0c57..e037b3ed 100644 --- a/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Help/visual_snapshot_of_help_command_output.snap @@ -1,5 +1,5 @@ - Pest Testing Framework 5.0.0-rc.11. + Pest Testing Framework 5.0.0-rc.12. USAGE: pest [options] diff --git a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap index f5307469..26f4d189 100644 --- a/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap +++ b/tests/.pest/snapshots/Visual/Version/visual_snapshot_of_help_command_output.snap @@ -1,3 +1,3 @@ - Pest Testing Framework 5.0.0-rc.11. + Pest Testing Framework 5.0.0-rc.12.