From b23f78604704a1ed13b65de9358fe69dcaf0934f Mon Sep 17 00:00:00 2001 From: Thomas Kerin Date: Sat, 30 Dec 2017 01:31:50 +0000 Subject: [PATCH] run mutation testing in CI --- .travis.yml | 12 ++++++------ infection.json.dist | 11 +++++++++++ tests/Types/IntegerBitSizeTest.php | 4 ++-- 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 infection.json.dist diff --git a/.travis.yml b/.travis.yml index 6f88ce5..529019c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,21 +8,21 @@ php: dist: trusty -before_install: - - composer selfupdate - install: - composer install --prefer-source --dev + - wget https://github.com/infection/infection/releases/download/0.7.0/infection.phar + - wget https://github.com/infection/infection/releases/download/0.7.0/infection.phar.pubkey + - chmod +x infection.phar script: - php vendor/bin/phpunit - - vendor/bin/phpstan analyze -l 4 src tests examples - php vendor/bin/phpcs -n --standard=PSR1,PSR2 --report=full src/ tests/ examples/ + - ./infection.phar --min-msi=75 --min-covered-msi=75 --threads=4 + - php vendor/bin/phpstan analyze -l 4 src tests examples - ./validate_examples.sh after_success: - - wget https://scrutinizer-ci.com/ocular.phar - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover build/docs/clover.xml; fi;' + - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ] && [ "$TRAVIS_PHP_VERSION" != "nightly" ]; then php ocular.phar code-coverage:upload --format=php-clover build/docs/clover.xml; fi matrix: fast_finish: true diff --git a/infection.json.dist b/infection.json.dist new file mode 100644 index 0000000..b883a21 --- /dev/null +++ b/infection.json.dist @@ -0,0 +1,11 @@ +{ + "timeout": 10, + "source": { + "directories": [ + "src" + ] + }, + "logs": { + "text": "infection-log.txt" + } +} \ No newline at end of file diff --git a/tests/Types/IntegerBitSizeTest.php b/tests/Types/IntegerBitSizeTest.php index 890b31a..b1e8b7f 100644 --- a/tests/Types/IntegerBitSizeTest.php +++ b/tests/Types/IntegerBitSizeTest.php @@ -2,7 +2,6 @@ namespace BitWasp\Buffertools\Tests\Types; - use BitWasp\Buffertools\Tests\BinaryTest; use BitWasp\Buffertools\Types\Int128; use BitWasp\Buffertools\Types\Int16; @@ -44,7 +43,8 @@ public function getClassAndBitSize() * @param string $integerClass * @param int $bitSize */ - public function testBitSize(string $integerClass, int $bitSize) { + public function testBitSize(string $integerClass, int $bitSize) + { /** @var UintInterface|SignedIntInterface $integer */ $integer = new $integerClass(); $this->assertEquals($bitSize, $integer->getBitSize());