From 90b8a71e129f7539d04f9a434d5e69a9948ca4bf Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Sun, 16 Jun 2024 00:01:36 +0200 Subject: [PATCH] fix tests namespace --- composer.json | 5 ++- infection.json5 | 35 +++++++++++++++++++++ tests/unit/autoload/functions_oxDICTest.php | 2 +- tests/unit/d3DicExceptionTest.php | 2 +- tests/unit/d3DicHandlerTest.php | 2 +- tests/unit/d3DicUtilitiesTest.php | 2 +- tests/unit/definitionFileContainerTest.php | 2 +- 7 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 infection.json5 diff --git a/composer.json b/composer.json index 9c0701b..12cb579 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ "friendsofphp/php-cs-fixer": "~3.13.0", "phpstan/phpstan": "^1.10", "rector/rector": "^0.18.13", - "mikey179/vfsstream": "^1.6.8" + "mikey179/vfsstream": "^1.6.8", + "infection/infection": "^0.29.5" }, "autoload": { "psr-4": { @@ -55,6 +56,8 @@ "phpunit": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/oxid-dic-handler/tests/ --no-coverage", "phpunit-coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --config=vendor/d3/oxid-dic-handler/tests/ --coverage-html=reports/phpunit/oxid-dic-handler", + "infection": "./vendor/bin/infection --configuration=vendor/d3/oxid-dic-handler/infection.json5", + "rector": "./vendor/bin/rector process --dry-run --config ./vendor/d3/oxid-dic-handler/rector.php" } } diff --git a/infection.json5 b/infection.json5 new file mode 100644 index 0000000..74879fd --- /dev/null +++ b/infection.json5 @@ -0,0 +1,35 @@ +{ + "source": { + "directories": [ + "vendor/d3/oxid-dic-handler" + ], + "excludes": [ + ".php-cs-fixer.php", + "rector.php", + "tests" + ] + }, + "timeout": 60, + "logs": { + "text": "../../../reports/infection/d3DICHandler/infection.log", + "html": "../../../reports/infection/d3DICHandler/infection.html", + "summary": "../../../reports/infection/d3DICHandler/summary.log", + "json": "../../../reports/infection/d3DICHandler/infection-log.json", + "perMutator": "../../../reports/infection/d3DICHandler/per-mutator.md", + "summaryJson": "../../../reports/infection/d3DICHandler/summary.json" + }, + "tmpDir": "./infection/tmp", + "phpUnit": { + "configDir": "tests" + }, + "mutators": { + "@default": true, + "@function_signature": false, + "global-ignoreSourceCodeByRegex": [ + ".*\\sstartProfile\\(.*", + ".*\\sstopProfile\\(.*" + ] + }, + "testFramework":"phpunit", + "bootstrap":"source/bootstrap.php" +} \ No newline at end of file diff --git a/tests/unit/autoload/functions_oxDICTest.php b/tests/unit/autoload/functions_oxDICTest.php index 13090ce..21fcd4b 100644 --- a/tests/unit/autoload/functions_oxDICTest.php +++ b/tests/unit/autoload/functions_oxDICTest.php @@ -15,7 +15,7 @@ declare(strict_types=1); -namespace D3\DIContainerHandler\tests\autoload; +namespace D3\DIContainerHandler\tests\unit\autoload; use D3\DIContainerHandler\d3DicException; use D3\TestingTools\Development\CanAccessRestricted; diff --git a/tests/unit/d3DicExceptionTest.php b/tests/unit/d3DicExceptionTest.php index 1a8d222..f879dce 100644 --- a/tests/unit/d3DicExceptionTest.php +++ b/tests/unit/d3DicExceptionTest.php @@ -15,7 +15,7 @@ declare(strict_types=1); -namespace D3\DIContainerHandler\tests; +namespace D3\DIContainerHandler\tests\unit; use D3\DIContainerHandler\d3DicException; use InvalidArgumentException; diff --git a/tests/unit/d3DicHandlerTest.php b/tests/unit/d3DicHandlerTest.php index 7c666ed..263f19f 100644 --- a/tests/unit/d3DicHandlerTest.php +++ b/tests/unit/d3DicHandlerTest.php @@ -15,7 +15,7 @@ declare(strict_types=1); -namespace D3\DIContainerHandler\tests; +namespace D3\DIContainerHandler\tests\unit; use D3\DIContainerHandler\d3DicException; use D3\DIContainerHandler\d3DicHandler; diff --git a/tests/unit/d3DicUtilitiesTest.php b/tests/unit/d3DicUtilitiesTest.php index 9714975..94064fe 100644 --- a/tests/unit/d3DicUtilitiesTest.php +++ b/tests/unit/d3DicUtilitiesTest.php @@ -15,7 +15,7 @@ declare(strict_types=1); -namespace D3\DIContainerHandler\tests; +namespace D3\DIContainerHandler\tests\unit; use D3\DIContainerHandler\d3DicHandler; use D3\DIContainerHandler\d3DicUtilities; diff --git a/tests/unit/definitionFileContainerTest.php b/tests/unit/definitionFileContainerTest.php index b7a6ec6..3e7a3d8 100644 --- a/tests/unit/definitionFileContainerTest.php +++ b/tests/unit/definitionFileContainerTest.php @@ -15,7 +15,7 @@ declare(strict_types=1); -namespace D3\DIContainerHandler\tests; +namespace D3\DIContainerHandler\tests\unit; use Assert\InvalidArgumentException; use D3\DIContainerHandler\definitionFileContainer;