|
19 | 19 | use Symfony\UX\Map\Tests\Kernel\TwigAppKernel; |
20 | 20 | use Symfony\UX\Map\Twig\MapExtension; |
21 | 21 | use Symfony\UX\Map\Twig\MapRuntime; |
22 | | -use Twig\DeprecatedCallableInfo; |
23 | 22 | use Twig\Environment; |
24 | | -use Twig\Loader\ArrayLoader; |
25 | | -use Twig\Loader\ChainLoader; |
26 | 23 |
|
27 | 24 | class MapExtensionTest extends KernelTestCase |
28 | 25 | { |
@@ -50,43 +47,6 @@ public function testRuntimeIsRegistered(): void |
50 | 47 | $this->assertInstanceOf(MapRuntime::class, $twig->getRuntime(MapRuntime::class)); |
51 | 48 | } |
52 | 49 |
|
53 | | - /** |
54 | | - * @group legacy |
55 | | - */ |
56 | | - public function testRenderFunctionIsDeprecated(): void |
57 | | - { |
58 | | - $map = (new Map()) |
59 | | - ->center(new Point(latitude: 5, longitude: 10)) |
60 | | - ->zoom(4); |
61 | | - |
62 | | - $renderer = self::createMock(RendererInterface::class); |
63 | | - $renderer |
64 | | - ->expects(self::once()) |
65 | | - ->method('renderMap') |
66 | | - ->with($map, []) |
67 | | - ->willReturn('<map/>') |
68 | | - ; |
69 | | - self::getContainer()->set('test.ux_map.renderers', $renderer); |
70 | | - |
71 | | - /** @var Environment $twig */ |
72 | | - $twig = self::getContainer()->get('twig'); |
73 | | - $twig->setLoader(new ChainLoader([ |
74 | | - new ArrayLoader([ |
75 | | - 'test' => '{{ render_map(map) }}', |
76 | | - ]), |
77 | | - $twig->getLoader(), |
78 | | - ])); |
79 | | - |
80 | | - if (class_exists(DeprecatedCallableInfo::class)) { |
81 | | - $this->expectDeprecation('Since symfony/ux-map 2.20: Twig Function "render_map" is deprecated; use "ux_map" instead in test at line 1.'); |
82 | | - } else { |
83 | | - $this->expectDeprecation('Twig Function "render_map" is deprecated since version 2.20. Use "ux_map" instead in test at line 1.'); |
84 | | - } |
85 | | - |
86 | | - $html = $twig->render('test', ['map' => $map]); |
87 | | - $this->assertSame('<map/>', $html); |
88 | | - } |
89 | | - |
90 | 50 | public function testMapFunctionWithArray(): void |
91 | 51 | { |
92 | 52 | $map = (new Map()) |
|
0 commit comments