Skip to content

Commit 9f4cb76

Browse files
authored
Add Symfony 7.0 test suite (#2437)
* Add Symfony 7.0 test suite * Run Symfony 7.0 Test Suite on PHP 8.3
1 parent 96ce878 commit 9f4cb76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1335
-22
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,7 @@ TEST_WEB_82 := \
879879
test_web_slim_4 \
880880
test_web_symfony_52 \
881881
test_web_symfony_62 \
882+
test_web_symfony_70 \
882883
test_web_wordpress_59 \
883884
test_web_wordpress_61 \
884885
test_web_custom \
@@ -925,6 +926,7 @@ TEST_WEB_83 := \
925926
test_web_slim_4 \
926927
test_web_symfony_52 \
927928
test_web_symfony_62 \
929+
test_web_symfony_70 \
928930
test_web_wordpress_59 \
929931
test_web_wordpress_61 \
930932
test_web_custom \
@@ -1213,6 +1215,10 @@ test_web_symfony_62: global_test_run_dependencies
12131215
$(COMPOSER) --working-dir=tests/Frameworks/Symfony/Version_6_2 update
12141216
php tests/Frameworks/Symfony/Version_6_2/bin/console cache:clear --no-warmup --env=prod
12151217
$(call run_tests,--testsuite=symfony-62-test)
1218+
test_web_symfony_70: global_test_run_dependencies
1219+
$(COMPOSER) --working-dir=tests/Frameworks/Symfony/Version_7_0 update
1220+
php tests/Frameworks/Symfony/Version_7_0/bin/console cache:clear --no-warmup --env=prod
1221+
$(call run_tests,--testsuite=symfony-70-test)
12161222

12171223
test_web_wordpress_48: global_test_run_dependencies
12181224
$(call run_tests,tests/Integrations/WordPress/V4_8)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# In all environments, the following files are loaded if they exist,
2+
# the latter taking precedence over the former:
3+
#
4+
# * .env contains default values for the environment variables needed by the app
5+
# * .env.local uncommitted file with local overrides
6+
# * .env.$APP_ENV committed environment-specific defaults
7+
# * .env.$APP_ENV.local uncommitted environment-specific overrides
8+
#
9+
# Real environment variables win over .env files.
10+
#
11+
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
12+
# https://symfony.com/doc/current/configuration/secrets.html
13+
#
14+
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
15+
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
16+
17+
###> symfony/framework-bundle ###
18+
APP_ENV=dev
19+
APP_SECRET=7b46ee8a78f39224283035fe148d0a79
20+
###< symfony/framework-bundle ###
21+
22+
###> doctrine/doctrine-bundle ###
23+
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
24+
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
25+
#
26+
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
27+
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=8.0.32&charset=utf8mb4"
28+
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
29+
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=15&charset=utf8"
30+
###< doctrine/doctrine-bundle ###
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
###> symfony/framework-bundle ###
3+
/.env.local
4+
/.env.local.php
5+
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
7+
/public/bundles/
8+
/var/
9+
/vendor/
10+
###< symfony/framework-bundle ###
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
use App\Kernel;
5+
use Symfony\Bundle\FrameworkBundle\Console\Application;
6+
7+
if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
8+
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
9+
}
10+
11+
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
12+
13+
return function (array $context) {
14+
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
15+
16+
return new Application($kernel);
17+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3'
2+
3+
services:
4+
###> doctrine/doctrine-bundle ###
5+
database:
6+
ports:
7+
- "5432"
8+
###< doctrine/doctrine-bundle ###
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3'
2+
3+
services:
4+
###> doctrine/doctrine-bundle ###
5+
database:
6+
image: postgres:${POSTGRES_VERSION:-15}-alpine
7+
environment:
8+
POSTGRES_DB: ${POSTGRES_DB:-app}
9+
# You should definitely change the password in production
10+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
11+
POSTGRES_USER: ${POSTGRES_USER:-app}
12+
volumes:
13+
- database_data:/var/lib/postgresql/data:rw
14+
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
15+
# - ./docker/db/data:/var/lib/postgresql/data:rw
16+
###< doctrine/doctrine-bundle ###
17+
18+
volumes:
19+
###> doctrine/doctrine-bundle ###
20+
database_data:
21+
###< doctrine/doctrine-bundle ###
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
{
2+
"type": "project",
3+
"license": "proprietary",
4+
"minimum-stability": "stable",
5+
"prefer-stable": true,
6+
"require": {
7+
"php": ">=8.2",
8+
"ext-ctype": "*",
9+
"ext-iconv": "*",
10+
"doctrine/annotations": "^2.0",
11+
"doctrine/doctrine-bundle": "^2.11",
12+
"doctrine/doctrine-migrations-bundle": "^3.3",
13+
"doctrine/orm": "^2.17",
14+
"symfony/console": "7.0.*",
15+
"symfony/dotenv": "7.0.*",
16+
"symfony/flex": "^2",
17+
"symfony/form": "7.0.*",
18+
"symfony/framework-bundle": "7.0.*",
19+
"symfony/monolog-bundle": "^3.10",
20+
"symfony/runtime": "7.0.*",
21+
"symfony/security-bundle": "7.0.*",
22+
"symfony/twig-bundle": "7.0.*",
23+
"symfony/validator": "7.0.*",
24+
"symfony/yaml": "7.0.*",
25+
"symfonycasts/verify-email-bundle": "^1.16"
26+
},
27+
"config": {
28+
"allow-plugins": {
29+
"symfony/flex": true,
30+
"php-http/discovery": true,
31+
"symfony/runtime": true
32+
},
33+
"sort-packages": true
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"App\\": "src/"
38+
},
39+
"files": ["../../../Appsec/Mock.php"]
40+
},
41+
"autoload-dev": {
42+
"psr-4": {
43+
"App\\Tests\\": "tests/"
44+
}
45+
},
46+
"replace": {
47+
"symfony/polyfill-ctype": "*",
48+
"symfony/polyfill-iconv": "*",
49+
"symfony/polyfill-php72": "*",
50+
"symfony/polyfill-php73": "*",
51+
"symfony/polyfill-php74": "*",
52+
"symfony/polyfill-php80": "*",
53+
"symfony/polyfill-php81": "*",
54+
"symfony/polyfill-php82": "*"
55+
},
56+
"scripts": {
57+
"auto-scripts": {
58+
"cache:clear": "symfony-cmd",
59+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
60+
},
61+
"post-install-cmd": [
62+
"@auto-scripts"
63+
],
64+
"post-update-cmd": [
65+
"@auto-scripts"
66+
],
67+
"post-autoload-dump": [
68+
"rm -rf var/cache/dev/*",
69+
"rm -rf var/cache/prod/*",
70+
"@php bin/console doctrine:database:drop --force",
71+
"@php bin/console doctrine:database:create",
72+
"@php bin/console doctrine:migrations:migrate -n"
73+
]
74+
},
75+
"conflict": {
76+
"symfony/symfony": "*"
77+
},
78+
"extra": {
79+
"symfony": {
80+
"allow-contrib": false,
81+
"require": "7.0.*"
82+
}
83+
},
84+
"require-dev": {
85+
"symfony/maker-bundle": "^1.49"
86+
}
87+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
return [
4+
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
5+
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
6+
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
7+
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
8+
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
9+
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
10+
SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle::class => ['all' => true],
11+
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
12+
];
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
framework:
2+
cache:
3+
# Unique name of your app: used to compute stable namespaces for cache keys.
4+
#prefix_seed: your_vendor_name/app_name
5+
6+
# The "app" cache stores to the filesystem by default.
7+
# The data in this cache should persist between deploys.
8+
# Other options include:
9+
10+
# Redis
11+
#app: cache.adapter.redis
12+
#default_redis_provider: redis://localhost
13+
14+
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues)
15+
#app: cache.adapter.apcu
16+
17+
# Namespaced pools use the above "app" backend by default
18+
#pools:
19+
#my.dedicated.cache: null
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
doctrine:
2+
dbal:
3+
url: 'mysql://test:test@mysql_integration:3306/test?serverVersion=5&charset=utf8mb4'
4+
5+
# IMPORTANT: You MUST configure your server version,
6+
# either here or in the DATABASE_URL env var (see .env file)
7+
#server_version: '15'
8+
9+
profiling_collect_backtrace: '%kernel.debug%'
10+
orm:
11+
auto_generate_proxy_classes: true
12+
enable_lazy_ghost_objects: true
13+
report_fields_where_declared: true
14+
validate_xml_mapping: true
15+
naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
16+
auto_mapping: true
17+
mappings:
18+
App:
19+
type: attribute
20+
is_bundle: false
21+
dir: '%kernel.project_dir%/src/Entity'
22+
prefix: 'App\Entity'
23+
alias: App
24+
25+
when@test:
26+
doctrine:
27+
dbal:
28+
# "TEST_TOKEN" is typically set by ParaTest
29+
dbname_suffix: '_test%env(default::TEST_TOKEN)%'
30+
31+
when@prod:
32+
doctrine:
33+
orm:
34+
auto_generate_proxy_classes: false
35+
proxy_dir: '%kernel.build_dir%/doctrine/orm/Proxies'
36+
query_cache_driver:
37+
type: pool
38+
pool: doctrine.system_cache_pool
39+
result_cache_driver:
40+
type: pool
41+
pool: doctrine.result_cache_pool
42+
43+
framework:
44+
cache:
45+
pools:
46+
doctrine.result_cache_pool:
47+
adapter: cache.app
48+
doctrine.system_cache_pool:
49+
adapter: cache.system
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
doctrine_migrations:
2+
migrations_paths:
3+
# namespace is arbitrary but should be different from App\Migrations
4+
# as migrations classes should NOT be autoloaded
5+
'DoctrineMigrations': '%kernel.project_dir%/migrations'
6+
enable_profiler: false
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# see https://symfony.com/doc/current/reference/configuration/framework.html
2+
framework:
3+
secret: '%env(APP_SECRET)%'
4+
csrf_protection: false
5+
handle_all_throwables: true
6+
7+
# Enables session support. Note that the session will ONLY be started if you read or write from it.
8+
# Remove or comment this section to explicitly disable session support.
9+
session:
10+
handler_id: null
11+
cookie_secure: false
12+
cookie_samesite: lax
13+
14+
#esi: true
15+
#fragments: true
16+
php_errors:
17+
log: true
18+
19+
when@test:
20+
framework:
21+
test: true
22+
session:
23+
storage_factory_id: session.storage.factory.mock_file
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
monolog:
2+
channels:
3+
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists
4+
5+
when@dev:
6+
monolog:
7+
handlers:
8+
main:
9+
type: stream
10+
path: "%kernel.logs_dir%/%kernel.environment%.log"
11+
level: debug
12+
channels: ["!event"]
13+
# uncomment to get logging in your browser
14+
# you may have to allow bigger header sizes in your Web server configuration
15+
#firephp:
16+
# type: firephp
17+
# level: info
18+
#chromephp:
19+
# type: chromephp
20+
# level: info
21+
console:
22+
type: console
23+
process_psr_3_messages: false
24+
channels: ["!event", "!doctrine", "!console"]
25+
26+
when@test:
27+
monolog:
28+
handlers:
29+
main:
30+
type: fingers_crossed
31+
action_level: error
32+
handler: nested
33+
excluded_http_codes: [404, 405]
34+
channels: ["!event"]
35+
nested:
36+
type: stream
37+
path: "%kernel.logs_dir%/%kernel.environment%.log"
38+
level: debug
39+
40+
when@prod:
41+
monolog:
42+
handlers:
43+
main:
44+
type: fingers_crossed
45+
action_level: error
46+
handler: nested
47+
excluded_http_codes: [404, 405]
48+
buffer_size: 50 # How many messages should be saved? Prevent memory leaks
49+
nested:
50+
type: stream
51+
path: php://stderr
52+
level: debug
53+
formatter: monolog.formatter.json
54+
console:
55+
type: console
56+
process_psr_3_messages: false
57+
channels: ["!event", "!doctrine"]
58+
deprecation:
59+
type: stream
60+
channels: [deprecation]
61+
path: php://stderr
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
framework:
2+
router:
3+
utf8: true
4+
5+
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
6+
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
7+
#default_uri: http://localhost
8+
9+
when@prod:
10+
framework:
11+
router:
12+
strict_requirements: null

0 commit comments

Comments
 (0)