Skip to content

Commit 07fd62d

Browse files
Merge pull request #9 from WikibaseSolutions/add-infection-testing
Add mutation testing
2 parents 723775f + 9ccd7c4 commit 07fd62d

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ jobs:
4141
rm -f installer expected
4242
mv composer.phar /usr/local/bin/composer
4343
44+
- name: Install Xdebug
45+
run: |
46+
pecl install xdebug
47+
docker-php-ext-enable xdebug
48+
4449
- name: Checkout repository
4550
uses: actions/checkout@v2
4651
with:
@@ -51,4 +56,7 @@ jobs:
5156
run: composer update --working-dir ${{ env.INSTALL_PATH }}
5257

5358
- name: Run unit tests
54-
run: composer test --working-dir ${{ env.INSTALL_PATH }}
59+
run: composer test --working-dir ${{ env.INSTALL_PATH }}
60+
61+
- name: Run mutation tests
62+
run: composer infect --working-dir ${{ env.INSTALL_PATH }}

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"ext-ctype": "*"
4040
},
4141
"require-dev": {
42-
"phpunit/phpunit": "~9.0"
42+
"phpunit/phpunit": "~9.0",
43+
"infection/infection": "^0.25.5"
4344
},
4445
"autoload": {
4546
"psr-4": {
@@ -52,7 +53,8 @@
5253
}
5354
},
5455
"scripts": {
55-
"test": "phpunit tests/"
56+
"test": "phpunit tests/",
57+
"infect": "XDEBUG_MODE=coverage infection --show-mutations"
5658
},
5759
"minimum-stability": "stable",
5860
"prefer-stable": true

infection.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "vendor/infection/infection/resources/schema.json",
3+
"source": {
4+
"directories": [
5+
"src"
6+
]
7+
},
8+
"mutators": {
9+
"@default": true
10+
}
11+
}

tests/Unit/Literals/BooleanTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\BooleanType;
2727

2828
/**
29-
* @covers \WikibaseSolutions\CypherDSL\Boolean
29+
* @covers \WikibaseSolutions\CypherDSL\Literals\Boolean
3030
*/
3131
class BooleanTest extends TestCase
3232
{

tests/Unit/Literals/DecimalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\NumeralType;
2727

2828
/**
29-
* @covers \WikibaseSolutions\CypherDSL\Decimal
29+
* @covers \WikibaseSolutions\CypherDSL\Literals\Decimal
3030
*/
3131
class DecimalTest extends TestCase
3232
{

tests/Unit/Literals/StringLiteralTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
use WikibaseSolutions\CypherDSL\Types\PropertyTypes\StringType;
2727

2828
/**
29-
* @covers \WikibaseSolutions\CypherDSL\StringLiteral
29+
* @covers \WikibaseSolutions\CypherDSL\Literals\StringLiteral
3030
*/
3131
class StringLiteralTest extends TestCase
3232
{

0 commit comments

Comments
 (0)