Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on: ['push', 'pull_request']
permissions:
contents: read

env:
COMPOSER_ROOT_VERSION: 5.x-dev

jobs:
static:
name: Static Tests
Expand All @@ -26,7 +29,7 @@ jobs:
coverage: none

- name: Install Dependencies
run: composer update --prefer-stable --no-interaction --no-progress --ansi
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi

- name: Types
run: composer test:types
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on: ['push', 'pull_request']
permissions:
contents: read

env:
COMPOSER_ROOT_VERSION: 5.x-dev

jobs:
ci:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -37,4 +40,4 @@ jobs:
run: composer update --${{ matrix.dependency-version }} --no-interaction --no-progress --ansi

- name: Unit Tests
run: composer test:unit
run: composer test:unit -- ${{ matrix.parallel }}
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
bootstrap="vendor/autoload.php"
cacheResult="false"
colors="true"
failOnRisky="true"
failOnWarning="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function mutate(Node $node): Node
]);
}

return $node->args[0]->value;
return $node->getArgs()[0]->value;
}

abstract public static function functionName(): string;
Expand Down
2 changes: 1 addition & 1 deletion src/Mutators/Removal/RemoveEarlyReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function can(Node $node): bool
if ($classMethod instanceof ClassMethod) {
break;
}
} while ($classMethod !== null);
} while ($classMethod instanceof Node);

if (! $classMethod instanceof ClassMethod) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion tests/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function mutationTestOutput(string $fixture): string
$process = new Process(
['php', 'vendor/bin/pest', 'tests/.tests/'.$fixture, '--mutate'],
dirname(__DIR__),
['COLUMNS' => 80, 'XDEBUG_MODE' => 'coverage', 'PEST_PLUGIN_INTERNAL_TEST_SUITE' => 1],
['COLUMNS' => 80, 'XDEBUG_MODE' => 'coverage', 'PEST_PLUGIN_INTERNAL_TEST_SUITE' => 1, 'PARATEST' => false],
);

$process->run();
Expand Down
19 changes: 19 additions & 0 deletions tests/Visual/MutationOutputTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

// Keep these tests together: their subprocesses share Pest's coverage report.
test('visual snapshot of mutation tests on success', function (): void {
expect(mutationTestOutput('Tested'))
->toMatchSnapshot();
});

test('visual snapshot of mutation tests with describe on success', function (): void {
expect(mutationTestOutput('TestedWithDescribe'))
->toMatchSnapshot();
});

test('visual snapshot of mutation tests when a mutant escaped', function (): void {
expect(mutationTestOutput('Untested'))
->toMatchSnapshot();
});
8 changes: 0 additions & 8 deletions tests/Visual/Tested.php

This file was deleted.

8 changes: 0 additions & 8 deletions tests/Visual/TestedWithDescribe.php

This file was deleted.

8 changes: 0 additions & 8 deletions tests/Visual/Untested.php

This file was deleted.

Loading