8000 minor #32740 [TwigBundle] Update tests inline with master version (yc… · symfony/symfony@c6a9e7a · GitHub
[go: up one dir, main page]

Skip to content

Commit c6a9e7a

Browse files
committed
minor #32740 [TwigBundle] Update tests inline with master version (yceruto)
This PR was merged into the 4.4 branch. Discussion ---------- [TwigBundle] Update tests inline with master version | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32714 (comment) | License | MIT | Doc PR | - Preparing to remove the `Resources/views` for TwigBundle in master branch #32714 /cc @Tobion Commits ------- 28a7ab8 [TwigBundle] Update tests inline with master version
2 parents f6e93de + 28a7ab8 commit c6a9e7a

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\TwigBundle\Tests\DependencyInjection\AcmeBundle;
13+
14+
use Symfony\Component\HttpKernel\Bundle\Bundle;
15+
16+
class AcmeBundle extends Bundle
17+
{
18+
}

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/AcmeBundle/Resources/views/layout.html.twig

Whitespace-only changes.

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/templates/bundles/AcmeBundle/layout.html.twig

Whitespace-only changes.

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/templates/bundles/TwigBundle/layout.html.twig

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\TwigBundle\DependencyInjection\Compiler\RuntimeLoaderPass;
1515
use Symfony\Bundle\TwigBundle\DependencyInjection\TwigExtension;
16+
use Symfony\Bundle\TwigBundle\Tests\DependencyInjection\AcmeBundle\AcmeBundle;
1617
use Symfony\Bundle\TwigBundle\Tests\TestCase;
1718
use Symfony\Component\Config\FileLocator;
1819
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
@@ -195,17 +196,17 @@ public function testTwigLoaderPaths($format)
195196
['namespaced_path1', 'namespace1'],
196197
['namespaced_path2', 'namespace2'],
197198
['namespaced_path3', 'namespace3'],
198-
[__DIR__.'/Fixtures/templates/bundles/TwigBundle', 'Twig'],
199-
[realpath(__DIR__.'/../..').'/Resources/views', 'Twig'],
200-
[realpath(__DIR__.'/../..').'/Resources/views', '!Twig'],
199+
[__DIR__.'/Fixtures/templates/bundles/AcmeBundle', 'Acme'],
200+
[__DIR__.'/AcmeBundle/Resources/views', 'Acme'],
201+
[__DIR__.'/AcmeBundle/Resources/views', '!Acme'],
201202
[__DIR__.'/Fixtures/templates'],
202203
], $paths);
203204
}
204205

205206
/**
206207
* @group legacy
207208
* @dataProvider getFormats
208-
* @expectedDeprecation Loading Twig templates for "TwigBundle" from the "%s/Resources/TwigBundle/views" directory is deprecated since Symfony 4.2, use "%s/templates/bundles/TwigBundle" instead.
209+
* @expectedDeprecation Loading Twig templates for "AcmeBundle" from the "%s/Resources/AcmeBundle/views" directory is deprecated since Symfony 4.2, use "%s/templates/bundles/AcmeBundle" instead.
209210
* @expectedDeprecation Loading Twig templates from the "%s/Resources/views" directory is deprecated since Symfony 4.2, use "%s/templates" instead.
210211
*/
211212
public function testLegacyTwigLoaderPaths($format)
@@ -230,10 +231,10 @@ public function testLegacyTwigLoaderPaths($format)
230231
['namespaced_path1', 'namespace1'],
231232
['namespaced_path2', 'namespace2'],
232233
['namespaced_path3', 'namespace3'],
233-
[__DIR__.'/../Fixtures/templates/Resources/TwigBundle/views', 'Twig'],
234-
[__DIR__.'/Fixtures/templates/bundles/TwigBundle', 'Twig'],
235-
[realpath(__DIR__.'/../..').'/Resources/views', 'Twig'],
236-
[realpath(__DIR__.'/../..').'/Resources/views', '!Twig'],
234+
[__DIR__.'/../Fixtures/templates/Resources/AcmeBundle/views', 'Acme'],
235+
[__DIR__.'/Fixtures/templates/bundles/AcmeBundle', 'Acme'],
236+
[__DIR__.'/AcmeBundle/Resources/views', 'Acme'],
237+
[__DIR__.'/AcmeBundle/Resources/views', '!Acme'],
237238
[__DIR__.'/../Fixtures/templates/Resources/views'],
238239
[__DIR__.'/Fixtures/templates'],
239240
], $paths);
@@ -323,12 +324,12 @@ private function createContainer(string $rootDir = __DIR__.'/Fixtures')
323324
'kernel.charset' => 'UTF-8',
324325
'kernel.debug' => false,
325326
'kernel.bundles' => [
326-
'TwigBundle' => 'Symfony\\Bundle\\TwigBundle\\TwigBundle',
327+
'AcmeBundle' => AcmeBundle::class,
327328
],
328329
'kernel.bundles_metadata' => [
329-
'TwigBundle' => [
330-
'namespace' => 'Symfony\\Bundle\\TwigBundle',
331-
'path' => realpath(__DIR__.'/../..'),
330+
'AcmeBundle' => [
331+
'namespace' => 'Symfony\Bundle\TwigBundle\Tests\DependencyInjection\AcmeBundle',
332+
'path' => __DIR__.'/AcmeBundle',
332333
],
333334
],
334335
]));

0 commit comments

Comments
 (0)
0