diff --git a/.env b/.env
new file mode 100644
index 0000000..afd9352
--- /dev/null
+++ b/.env
@@ -0,0 +1 @@
+APP_ENV=test
diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php
index b554687..fd31b79 100644
--- a/.php-cs-fixer.dist.php
+++ b/.php-cs-fixer.dist.php
@@ -2,7 +2,7 @@
$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/packages')
- ->in(__DIR__ . '/tests')
+ ->in(__DIR__ . '/tests/src')
;
@@ -10,7 +10,9 @@
return $config->setRules([
'@PER-CS2.0' => true,
'@PER-CS2.0:risky' => true,
- 'fully_qualified_strict_types' => true,
+ 'fully_qualified_strict_types' => [
+ 'import_symbols' => true,
+ ],
'global_namespace_import' => [
'import_classes' => false,
'import_constants' => false,
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3e562dd..512c2fe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# CHANGELOG
+## 1.11.0
+
+* test: modernization
+
## 1.10.2
* chore: cleanup `composer.json`
diff --git a/Makefile b/Makefile
index d7af4c3..4302d91 100644
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,7 @@ psalm:
.PHONY: phpunit
phpunit:
$(eval c ?=)
+ rm -rf tests/var
vendor/bin/phpunit $(c)
.PHONY: composer-dump
diff --git a/composer.json b/composer.json
index a2b693d..6b5f4a6 100644
--- a/composer.json
+++ b/composer.json
@@ -29,7 +29,7 @@
"psr/http-factory-implementation": "^1.0",
"psr/http-message": "^1.0 || ^2.0",
"rekalogika/direct-property-access": "^1.1.2 || ^1.2",
- "rekalogika/doctrine-collections-decorator": "^2.0",
+ "rekalogika/doctrine-collections-decorator": "^2.3",
"rekalogika/reconstitutor": "^1.3.2 || ^1.4",
"rekalogika/temporary-url-bundle": "^1.3",
"symfony/config": "^6.2 || ^7.0",
@@ -53,7 +53,7 @@
"ekino/phpstan-banned-code": "^2.1",
"league/flysystem-memory": "^3.16",
"mockery/mockery": "^1.6",
- "phpstan/phpstan": "1.12.2 || ^1.12.4 || ^1.13",
+ "phpstan/phpstan": "^1.12.5 || ^1.13",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-mockery": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
@@ -63,11 +63,14 @@
"rector/rector": "^1.2",
"symfony/asset-mapper": "^6.2 || ^7.0",
"symfony/console": "^6.2 || ^7.0",
+ "symfony/debug-bundle": "^6.2 || ^7.0",
+ "symfony/dotenv": "^6.2 || ^7.0",
"symfony/framework-bundle": "^6.2 || ^7.0",
"symfony/http-client": "^6.2 || ^7.0",
"symfony/phpunit-bridge": "^6.3 || ^7.0",
"symfony/property-info": "^6.2 || ^7.0",
"symfony/routing": "^6.2 || ^7.0",
+ "symfony/runtime": "^6.2 || ^7.0",
"symfony/yaml": "^6.2 || ^7.0",
"symplify/monorepo-builder": "^11.2.20 || ^11.3",
"vimeo/psalm": "^5.26"
@@ -115,12 +118,13 @@
},
"autoload-dev": {
"psr-4": {
- "Rekalogika\\File\\Tests\\": "tests/"
+ "Rekalogika\\File\\Tests\\": "tests/src/"
}
},
"config": {
"allow-plugins": {
- "php-http/discovery": true
+ "php-http/discovery": true,
+ "symfony/runtime": true
}
}
}
diff --git a/packages/file-bundle/config/tests.php b/packages/file-bundle/config/tests.php
index 1ca12fc..675d489 100644
--- a/packages/file-bundle/config/tests.php
+++ b/packages/file-bundle/config/tests.php
@@ -27,9 +27,9 @@
// add test aliases
$serviceIds = TestKernel::getServiceIds();
- foreach ($serviceIds as $serviceId) {
- $services->alias('test.' . $serviceId, $serviceId)->public();
- }
+ // foreach ($serviceIds as $serviceId) {
+ // $services->set($serviceId)->public();
+ // }
// filesystem for testing
$services->set('test.filesystem', FilesystemOperator::class)
diff --git a/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php b/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php
index 96a89b8..f870e06 100644
--- a/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php
+++ b/packages/file-symfony-bridge/src/HttpFoundation/ToHttpFoundationFileAdapter.php
@@ -188,6 +188,7 @@ public function getPath(): string
#[\Override]
public function getPathInfo($class = null): ?\SplFileInfo
{
+ // @phpstan-ignore return.type
return $this->getHttpFoundationFile()->getPathInfo($class);
}
diff --git a/phpstan.neon.dist b/phpstan.neon.dist
index 34675c6..91eeea5 100644
--- a/phpstan.neon.dist
+++ b/phpstan.neon.dist
@@ -2,7 +2,7 @@ parameters:
level: max
paths:
- packages
- - tests
+ - tests/src
# exceptions:
# check:
# missingCheckedExceptionInThrows: true
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 25f2468..1dba7de 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -9,11 +9,19 @@
failOnWarning="false"
cacheDirectory=".phpunit.cache"
beStrictAboutCoverageMetadata="true">
+
+
+
+
+
- tests
+ tests/src/
+