This commit is contained in:
Fabien Potencier
2024-01-06 16:51:59 +01:00
parent a9c7307b5c
commit 4fd62abb87
5 changed files with 10 additions and 6 deletions
+4 -1
View File
@@ -20,6 +20,9 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
env:
SYMFONY_DEPRECATIONS_HELPER: ignoreFile=./tests/ignore-use-yield-deprecations
strategy:
matrix:
php-version:
@@ -132,7 +135,7 @@ jobs:
- name: "Run tests"
working-directory: extra/${{ matrix.extension }}
run: ../../vendor/bin/simple-phpunit
run: SYMFONY_DEPRECATIONS_HELPER=ignoreFile=../../tests/ignore-use-yield-deprecations ../../vendor/bin/simple-phpunit
integration-tests:
needs:
+2
View File
@@ -1,5 +1,7 @@
# 3.9.0 (2023-XX-XX)
* Add a new "yield" mode for output generation
The "use_yield" Environment option controls the strategy: use "false" for "echo", "true" for "yield"
* Add return type for Symfony 7 compatibility
* Fix premature loop exit in Security Policy lookup of allowed methods/properties
* Deprecate all internal extension functions in favor of methods on the extension classes
+1 -3
View File
@@ -304,8 +304,7 @@ EOHTML
],
];
}
/* These tests don't make sense to me
Depending on whether you're using echo ->render() or display(), they don't behave in the same way
public function testTwigLeakOutputInDebugMode()
{
$output = exec(sprintf('%s %s debug', \PHP_BINARY, escapeshellarg(__DIR__.'/Fixtures/errors/leak-output.php')));
@@ -319,7 +318,6 @@ EOHTML
$this->assertSame('', $output);
}
*/
}
class ErrorTest_Foo
+2 -2
View File
@@ -27,7 +27,7 @@ class BrokenExtension extends AbstractExtension
$loader = new ArrayLoader([
'index.html.twig' => 'Hello {{ "world"|broken }}',
]);
$twig = new Environment($loader, ['debug' => isset($argv[1])]);
$twig = new Environment($loader, ['debug' => isset($argv[1]), 'use_yield' => false]);
$twig->addExtension(new BrokenExtension());
$twig->display('index.html.twig');
echo $twig->render('index.html.twig');
+1
View File
@@ -0,0 +1 @@
%Since twig/twig 3.9.0: Not setting "use_yield" to "true" is deprecated.%