mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-26 03:58:45 +02:00
N°3129 PHP 8.0 compat: Fix "Deprecated: Required parameter ... follows optional parameter ..." in Twig
Update symfony/twig-bundle from 3.4.36 to 3.4.47
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bundle\TwigBundle\Tests\DependencyInjection\Compiler;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bridge\Twig\Extension\FormExtension;
|
||||
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\TwigEnvironmentPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\DependencyInjection\Reference;
|
||||
|
||||
class TwigEnvironmentPassTest extends TestCase
|
||||
{
|
||||
public function testTwigBridgeExtensionsAreRegisteredFirst()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$twigDefinition = $container->register('twig');
|
||||
$container->register('other_extension', 'Foo\Bar')
|
||||
->addTag('twig.extension');
|
||||
$container->register('twig_bridge_extension', FormExtension::class)
|
||||
->addTag('twig.extension');
|
||||
|
||||
$twigEnvironmentPass = new TwigEnvironmentPass();
|
||||
$twigEnvironmentPass->process($container);
|
||||
|
||||
$methodCalls = $twigDefinition->getMethodCalls();
|
||||
$this->assertCount(2, $methodCalls);
|
||||
|
||||
$twigBridgeExtensionReference = $methodCalls[0][1][0];
|
||||
$this->assertInstanceOf(Reference::class, $twigBridgeExtensionReference);
|
||||
$this->assertSame('twig_bridge_extension', (string) $twigBridgeExtensionReference);
|
||||
|
||||
$otherExtensionReference = $methodCalls[1][1][0];
|
||||
$this->assertInstanceOf(Reference::class, $otherExtensionReference);
|
||||
$this->assertSame('other_extension', (string) $otherExtensionReference);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user