Skip to content

Commit 770be58

Browse files
committed
Add mutation testing
1 parent 83c42b2 commit 770be58

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ jobs:
3838
restore-keys: ${{ matrix.os }}-composer-${{ matrix.php-versions }}-
3939

4040
- name: Install dependencies
41-
run: composer install --prefer-dist
41+
run: |
42+
composer install --prefer-dist
43+
wget https://github.com/infection/infection/releases/download/0.27.0/infection.phar -O /usr/local/bin/infection
44+
chmod +x /usr/local/bin/infection
4245
4346
- name: Run tests
4447
env:
@@ -47,6 +50,7 @@ jobs:
4750
vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
4851
vendor/bin/php-cs-fixer --diff --dry-run -v fix
4952
vendor/bin/psalm.phar --shepherd
53+
infection --show-mutations --threads=$(nproc)
5054
5155
- name: Upload coverage to Codecov
5256
env:

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" resolveDependencies="true" executionOrder="random">
33
<coverage>
44
<include>
55
<directory suffix=".php">lib</directory>

test/GenericTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ private function fixtureAssertions(callable $closure, int &$runCount, ?float &$p
290290
$this->assertTrue($loop->isPaused());
291291

292292
$pauseTime = GenericLoop::STOP;
293-
$this->assertTrue($loop->resume(false));
294-
$this->assertTrue($loop->resume(false));
293+
$this->assertTrue($loop->resume());
294+
EventLoop::queue(fn () => $this->assertTrue($loop->resume()));
295295
$expectedRunCount++;
296296
self::waitTick();
297297
$this->assertEquals($expectedRunCount, $runCount);

0 commit comments

Comments
 (0)