diff --git a/Makefile b/Makefile index 8c11203..e1ffc2c 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,8 @@ tests: .PHONY: lint lint: php vendor/bin/parallel-lint --colors \ - --exclude tests/Rules/DeadCode/data/bug-383.php \ + --exclude tests/phpt/infection-config-default.phpt \ + --exclude tests/phpt/infection-config.phpt \ src tests .PHONY: cs-install diff --git a/bin/infection-config.php b/bin/infection-config.php index e7a6e3a..2697a32 100644 --- a/bin/infection-config.php +++ b/bin/infection-config.php @@ -1,24 +1,31 @@ #!/usr/bin/env php source->directories[] = $path; } foreach($addMutatorClasses as $mutatorclass) { $decoded->mutators->$mutatorclass = true; } +if ($timeout !== null) { + $decoded->timeout = (int) $timeout; +} echo json_encode($decoded); diff --git a/phpstan.neon b/phpstan.neon index 6d7c0fd..834f007 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,7 @@ parameters: level: 8 paths: + - bin - src - tests diff --git a/phpunit.xml b/phpunit.xml index 4674938..c2392f8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,19 +1,23 @@ - - - tests - - + + + tests + - + + tests/phpt + + + + diff --git a/tests/phpt/infection-config-default.phpt b/tests/phpt/infection-config-default.phpt new file mode 100644 index 0000000..78d75bf --- /dev/null +++ b/tests/phpt/infection-config-default.phpt @@ -0,0 +1,25 @@ +--TEST-- +infection-config.php renders proper json defaults +--FILE-- +