Merge branch '3.x' into 4.x

* 3.x:
  Set LANG=en_US.UTF-8 for the extra packages tests
  Use per-extension PHPUnit bridge and force PHPUnit 11 on PHP 8.2+
  Install a custom exception handler before bootstrapping KernelTestCase
  Simplify code

# Conflicts:
#	.github/workflows/ci.yml
#	extra/twig-extra-bundle/phpunit.xml.dist
This commit is contained in:
Fabien Potencier
2026-05-24 11:11:20 +02:00
2 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -52,6 +52,9 @@ jobs:
continue-on-error: true
env:
SYMFONY_PHPUNIT_VERSION: ${{ matrix.php-version == '8.1' && '9.6' || '11.3' }}
strategy:
matrix:
php-version:
@@ -83,7 +86,7 @@ jobs:
- name: "Add PHPUnit matcher"
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: "Prevent installing symfony/translation-contract 3.0"
- name: "Prevent installing symfony/translation-contracts 3.0"
if: "matrix.extension == 'twig-extra-bundle'"
working-directory: extra/${{ matrix.extension }}
run: "composer require --no-update 'symfony/translation-contracts:^1.1|^2.0'"
@@ -95,6 +98,10 @@ jobs:
- name: "Run tests for ${{ matrix.extension }}"
working-directory: extra/${{ matrix.extension }}
env:
# intl-extra's integration tests expect en_US-formatted ICU output. The Ubuntu
# runner default (C.UTF-8) makes ICU fall back to the "C" locale, producing e.g.
# "€ 1000000.00" instead of "€1,000,000.00". phpunit.xml.dist's <env> entry is
# too late because ICU caches the default locale at the first call.
LANG: 'en_US.UTF-8'
run: phpunit
+3 -3
View File
@@ -52,9 +52,9 @@ class CheckSecurityNode extends Node
->indent()
->write("\$this->sandbox->checkSecurity(\n")
->indent()
->write(!$this->usedTags ? "[],\n" : "['".implode("', '", array_keys($this->usedTags))."'],\n")
->write(!$this->usedFilters ? "[],\n" : "['".implode("', '", array_keys($this->usedFilters))."'],\n")
->write(!$this->usedFunctions ? "[],\n" : "['".implode("', '", array_keys($this->usedFunctions))."'],\n")
->write('')->repr(array_keys($this->usedTags))->raw(",\n")
->write('')->repr(array_keys($this->usedFilters))->raw(",\n")
->write('')->repr(array_keys($this->usedFunctions))->raw(",\n")
->write("\$this->source\n")
->outdent()
->write(");\n")