Skip to content

Commit 3bfb8c2

Browse files
committed
minor symfony#52169 Rename fixtures paths to be consistent (smnandre)
This PR was squashed before being merged into the 6.4 branch. Discussion ---------- Rename fixtures paths to be consistent | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no (maybe) | New feature? | no | Deprecations? | no | License | MIT There are currently two components with a "fixtures" (lowercase) folder, * [Symfony/Component/AssetMapper/Tests/fixtures](https://github.com/symfony/symfony/tree/6.4/src/Symfony/Component/AssetMapper/Tests/fixtures) * [Symfony/Component/Translation/Tests/fixtures](https://github.com/symfony/symfony/tree/6.4/src/Symfony/Component/Translation/Tests/fixtures) So on case-sensitive filesystems the following exclusion in php-cs-fixer does not work. ```php (new PhpCsFixer\Finder()) ->in(__DIR__.'/src') ->append([__FILE__]) ->notPath('#/Fixtures/#') ``` Those are the files who are currently not excluded on case-sensitive filesystems ```console php-cs-fixer list-files | grep fixtures './src/Symfony/Component/Translation/Tests/fixtures/extractor-ast/translation.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor-ast/translatable-short.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor-ast/translatable-fqn.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor-ast/translatable.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor-ast/validator-constraints.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor/translation.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor/translatable-short.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor/translatable-fqn.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor/translatable.html.php' './src/Symfony/Component/Translation/Tests/fixtures/extractor-7.3/translation.html.php' './src/Symfony/Component/AssetMapper/Tests/fixtures/importmap.php' './src/Symfony/Component/AssetMapper/Tests/fixtures/importmaps/importmap.php' './src/Symfony/Component/AssetMapper/Tests/fixtures/AssetMapperTestAppKernel.php' ``` This PR exclude files in both senstivie / insenstive systems. Commits ------- ec09b40 Rename fixtures paths to be consistent
2 parents 5929aa1 + ec09b40 commit 3bfb8c2

File tree

152 files changed

+197
-197
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+197
-197
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
->notPath('#Symfony/Bridge/PhpUnit/.*Mock\.php#')
6161
->notPath('#Symfony/Bridge/PhpUnit/.*Legacy#')
6262
// file content autogenerated by `var_export`
63-
->notPath('Symfony/Component/Translation/Tests/fixtures/resources.php')
63+
->notPath('Symfony/Component/Translation/Tests/Fixtures/resources.php')
6464
// file content autogenerated by `VarExporter::export`
6565
->notPath('Symfony/Component/Serializer/Tests/Fixtures/serializer.class.metadata.php')
6666
// test template

src/Symfony/Component/Asset/Tests/VersionStrategy/JsonManifestVersionStrategyTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public static function provideMissingStrategies(): \Generator
100100
public static function provideStrategies(string $manifestPath): \Generator
101101
{
102102
$httpClient = new MockHttpClient(function ($method, $url, $options) {
103-
$filename = __DIR__.'/../fixtures/'.basename($url);
103+
$filename = __DIR__.'/../Fixtures/'.basename($url);
104104

105105
if (file_exists($filename)) {
106106
return new MockResponse(file_get_contents($filename), ['http_headers' => ['content-type' => 'application/json']]);
@@ -111,12 +111,12 @@ public static function provideStrategies(string $manifestPath): \Generator
111111

112112
yield [new JsonManifestVersionStrategy('https://cdn.example.com/'.$manifestPath, $httpClient)];
113113

114-
yield [new JsonManifestVersionStrategy(__DIR__.'/../fixtures/'.$manifestPath)];
114+
yield [new JsonManifestVersionStrategy(__DIR__.'/../Fixtures/'.$manifestPath)];
115115
}
116116

117117
public static function provideStrictStrategies(): \Generator
118118
{
119-
$strategy = new JsonManifestVersionStrategy(__DIR__.'/../fixtures/manifest-valid.json', null, true);
119+
$strategy = new JsonManifestVersionStrategy(__DIR__.'/../Fixtures/manifest-valid.json', null, true);
120120

121121
yield [
122122
$strategy,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
vendor/
22
composer.lock
33
phpunit.xml
4-
Tests/fixtures/var/
4+
Tests/Fixtures/var/

src/Symfony/Component/AssetMapper/Tests/AssetMapperDevServerSubscriberFunctionalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\AssetMapper\Tests;
1313

1414
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
15-
use Symfony\Component\AssetMapper\Tests\fixtures\AssetMapperTestAppKernel;
15+
use Symfony\Component\AssetMapper\Tests\Fixtures\AssetMapperTestAppKernel;
1616

1717
class AssetMapperDevServerSubscriberFunctionalTest extends WebTestCase
1818
{

src/Symfony/Component/AssetMapper/Tests/AssetMapperRepositoryTest.php

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ class AssetMapperRepositoryTest extends TestCase
2020
public function testFindWithAbsolutePaths()
2121
{
2222
$repository = new AssetMapperRepository([
23-
__DIR__.'/fixtures/dir1' => '',
24-
__DIR__.'/fixtures/dir2' => '',
23+
__DIR__.'/Fixtures/dir1' => '',
24+
__DIR__.'/Fixtures/dir2' => '',
2525
], __DIR__);
2626

27-
$this->assertSame(realpath(__DIR__.'/fixtures/dir1/file1.css'), $repository->find('file1.css'));
28-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/file4.js'), $repository->find('file4.js'));
29-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/subdir/file5.js'), $repository->find('subdir/file5.js'));
27+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir1/file1.css'), $repository->find('file1.css'));
28+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/file4.js'), $repository->find('file4.js'));
29+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/subdir/file5.js'), $repository->find('subdir/file5.js'));
3030
$this->assertNull($repository->find('file5.css'));
3131
}
3232

@@ -35,34 +35,34 @@ public function testFindWithRelativePaths()
3535
$repository = new AssetMapperRepository([
3636
'dir1' => '',
3737
'dir2' => '',
38-
], __DIR__.'/fixtures');
38+
], __DIR__.'/Fixtures');
3939

40-
$this->assertSame(realpath(__DIR__.'/fixtures/dir1/file1.css'), $repository->find('file1.css'));
41-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/file4.js'), $repository->find('file4.js'));
42-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/subdir/file5.js'), $repository->find('subdir/file5.js'));
40+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir1/file1.css'), $repository->find('file1.css'));
41+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/file4.js'), $repository->find('file4.js'));
42+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/subdir/file5.js'), $repository->find('subdir/file5.js'));
4343
$this->assertNull($repository->find('file5.css'));
4444
}
4545

4646
public function testFindWithMovingPaths()
4747
{
4848
$repository = new AssetMapperRepository([
49-
__DIR__.'/../Tests/fixtures/dir2' => '',
49+
__DIR__.'/../Tests/Fixtures/dir2' => '',
5050
], __DIR__);
5151

52-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/file4.js'), $repository->find('file4.js'));
53-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/file4.js'), $repository->find('subdir/../file4.js'));
52+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/file4.js'), $repository->find('file4.js'));
53+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/file4.js'), $repository->find('subdir/../file4.js'));
5454
}
5555

5656
public function testFindWithNamespaces()
5757
{
5858
$repository = new AssetMapperRepository([
5959
'dir1' => 'dir1_namespace',
6060
'dir2' => 'dir2_namespace',
61-
], __DIR__.'/fixtures');
61+
], __DIR__.'/Fixtures');
6262

63-
$this->assertSame(realpath(__DIR__.'/fixtures/dir1/file1.css'), $repository->find('dir1_namespace/file1.css'));
64-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/file4.js'), $repository->find('dir2_namespace/file4.js'));
65-
$this->assertSame(realpath(__DIR__.'/fixtures/dir2/subdir/file5.js'), $repository->find('dir2_namespace/subdir/file5.js'));
63+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir1/file1.css'), $repository->find('dir1_namespace/file1.css'));
64+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/file4.js'), $repository->find('dir2_namespace/file4.js'));
65+
$this->assertSame(realpath(__DIR__.'/Fixtures/dir2/subdir/file5.js'), $repository->find('dir2_namespace/subdir/file5.js'));
6666
// non-namespaced path does not work
6767
$this->assertNull($repository->find('file4.js'));
6868
}
@@ -73,10 +73,10 @@ public function testFindLogicalPath()
7373
'dir' => '',
7474
'dir1' => 'some_namespace',
7575
'dir2' => '',
76-
], __DIR__.'/fixtures');
77-
$this->assertSame('subdir/file5.js', $repository->findLogicalPath(__DIR__.'/fixtures/dir2/subdir/file5.js'));
78-
$this->assertSame('some_namespace/file2.js', $repository->findLogicalPath(__DIR__.'/fixtures/dir1/file2.js'));
79-
$this->assertSame('some_namespace/file2.js', $repository->findLogicalPath(__DIR__.'/../Tests/fixtures/dir1/file2.js'));
76+
], __DIR__.'/Fixtures');
77+
$this->assertSame('subdir/file5.js', $repository->findLogicalPath(__DIR__.'/Fixtures/dir2/subdir/file5.js'));
78+
$this->assertSame('some_namespace/file2.js', $repository->findLogicalPath(__DIR__.'/Fixtures/dir1/file2.js'));
79+
$this->assertSame('some_namespace/file2.js', $repository->findLogicalPath(__DIR__.'/../Tests/Fixtures/dir1/file2.js'));
8080
}
8181

8282
public function testAll()
@@ -85,21 +85,21 @@ public function testAll()
8585
'dir1' => '',
8686
'dir2' => '',
8787
'dir3' => '',
88-
], __DIR__.'/fixtures');
88+
], __DIR__.'/Fixtures');
8989

9090
$actualAllAssets = $repository->all();
9191
$this->assertCount(8, $actualAllAssets);
9292

9393
// use realpath to normalize slashes on Windows for comparison
9494
$expectedAllAssets = array_map('realpath', [
95-
'file1.css' => __DIR__.'/fixtures/dir1/file1.css',
96-
'file2.js' => __DIR__.'/fixtures/dir1/file2.js',
97-
'already-abcdefVWXYZ0123456789.digested.css' => __DIR__.'/fixtures/dir2/already-abcdefVWXYZ0123456789.digested.css',
98-
'file3.css' => __DIR__.'/fixtures/dir2/file3.css',
99-
'file4.js' => __DIR__.'/fixtures/dir2/file4.js',
100-
'subdir/file5.js' => __DIR__.'/fixtures/dir2/subdir/file5.js',
101-
'subdir/file6.js' => __DIR__.'/fixtures/dir2/subdir/file6.js',
102-
'test.gif.foo' => __DIR__.'/fixtures/dir3/test.gif.foo',
95+
'file1.css' => __DIR__.'/Fixtures/dir1/file1.css',
96+
'file2.js' => __DIR__.'/Fixtures/dir1/file2.js',
97+
'already-abcdefVWXYZ0123456789.digested.css' => __DIR__.'/Fixtures/dir2/already-abcdefVWXYZ0123456789.digested.css',
98+
'file3.css' => __DIR__.'/Fixtures/dir2/file3.css',
99+
'file4.js' => __DIR__.'/Fixtures/dir2/file4.js',
100+
'subdir/file5.js' => __DIR__.'/Fixtures/dir2/subdir/file5.js',
101+
'subdir/file6.js' => __DIR__.'/Fixtures/dir2/subdir/file6.js',
102+
'test.gif.foo' => __DIR__.'/Fixtures/dir3/test.gif.foo',
103103
]);
104104
$this->assertEquals($expectedAllAssets, array_map('realpath', $actualAllAssets));
105105
}
@@ -110,17 +110,17 @@ public function testAllWithNamespaces()
110110
'dir1' => 'dir1_namespace',
111111
'dir2' => 'dir2_namespace',
112112
'dir3' => 'dir3_namespace',
113-
], __DIR__.'/fixtures');
113+
], __DIR__.'/Fixtures');
114114

115115
$expectedAllAssets = [
116-
'dir1_namespace/file1.css' => __DIR__.'/fixtures/dir1/file1.css',
117-
'dir1_namespace/file2.js' => __DIR__.'/fixtures/dir1/file2.js',
118-
'dir2_namespace/already-abcdefVWXYZ0123456789.digested.css' => __DIR__.'/fixtures/dir2/already-abcdefVWXYZ0123456789.digested.css',
119-
'dir2_namespace/file3.css' => __DIR__.'/fixtures/dir2/file3.css',
120-
'dir2_namespace/file4.js' => __DIR__.'/fixtures/dir2/file4.js',
121-
'dir2_namespace/subdir/file5.js' => __DIR__.'/fixtures/dir2/subdir/file5.js',
122-
'dir2_namespace/subdir/file6.js' => __DIR__.'/fixtures/dir2/subdir/file6.js',
123-
'dir3_namespace/test.gif.foo' => __DIR__.'/fixtures/dir3/test.gif.foo',
116+
'dir1_namespace/file1.css' => __DIR__.'/Fixtures/dir1/file1.css',
117+
'dir1_namespace/file2.js' => __DIR__.'/Fixtures/dir1/file2.js',
118+
'dir2_namespace/already-abcdefVWXYZ0123456789.digested.css' => __DIR__.'/Fixtures/dir2/already-abcdefVWXYZ0123456789.digested.css',
119+
'dir2_namespace/file3.css' => __DIR__.'/Fixtures/dir2/file3.css',
120+
'dir2_namespace/file4.js' => __DIR__.'/Fixtures/dir2/file4.js',
121+
'dir2_namespace/subdir/file5.js' => __DIR__.'/Fixtures/dir2/subdir/file5.js',
122+
'dir2_namespace/subdir/file6.js' => __DIR__.'/Fixtures/dir2/subdir/file6.js',
123+
'dir3_namespace/test.gif.foo' => __DIR__.'/Fixtures/dir3/test.gif.foo',
124124
];
125125

126126
$normalizedExpectedAllAssets = array_map('realpath', $expectedAllAssets);
@@ -146,7 +146,7 @@ public function testExcludedPaths()
146146
'dir1' => '',
147147
'dir2' => '',
148148
'dir3' => '',
149-
], __DIR__.'/fixtures', $excludedGlobs);
149+
], __DIR__.'/Fixtures', $excludedGlobs);
150150

151151
$expectedAssets = [
152152
'file1.css',
@@ -160,6 +160,6 @@ public function testExcludedPaths()
160160
$this->assertEquals($expectedAssets, $actualAssets);
161161

162162
$this->assertNull($repository->find('file3.css'));
163-
$this->assertNull($repository->findLogicalPath(__DIR__.'/fixtures/dir2/file3.css'));
163+
$this->assertNull($repository->findLogicalPath(__DIR__.'/Fixtures/dir2/file3.css'));
164164
}
165165
}

src/Symfony/Component/AssetMapper/Tests/AssetMapperTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testGetAsset()
3030
$file1Asset = new MappedAsset('file1.css');
3131
$this->mappedAssetFactory->expects($this->once())
3232
->method('createMappedAsset')
33-
->with('file1.css', realpath(__DIR__.'/fixtures/dir1/file1.css'))
33+
->with('file1.css', realpath(__DIR__.'/Fixtures/dir1/file1.css'))
3434
->willReturn($file1Asset);
3535

3636
$actualAsset = $assetMapper->getAsset('file1.css');
@@ -79,21 +79,21 @@ public function testGetAssetFromFilesystemPath()
7979

8080
$this->mappedAssetFactory->expects($this->once())
8181
->method('createMappedAsset')
82-
->with('file1.css', realpath(__DIR__.'/fixtures/dir1/file1.css'))
82+
->with('file1.css', realpath(__DIR__.'/Fixtures/dir1/file1.css'))
8383
->willReturn(new MappedAsset('file1.css'));
8484

85-
$asset = $assetMapper->getAssetFromSourcePath(__DIR__.'/fixtures/dir1/file1.css');
85+
$asset = $assetMapper->getAssetFromSourcePath(__DIR__.'/Fixtures/dir1/file1.css');
8686
$this->assertSame('file1.css', $asset->logicalPath);
8787
}
8888

8989
private function createAssetMapper(): AssetMapper
9090
{
9191
$dirs = ['dir1' => '', 'dir2' => '', 'dir3' => ''];
92-
$repository = new AssetMapperRepository($dirs, __DIR__.'/fixtures');
92+
$repository = new AssetMapperRepository($dirs, __DIR__.'/Fixtures');
9393
$pathResolver = $this->createMock(PublicAssetsPathResolverInterface::class);
9494
$pathResolver->expects($this->any())
9595
->method('getPublicFilesystemPath')
96-
->willReturn(__DIR__.'/fixtures/test_public/final-assets');
96+
->willReturn(__DIR__.'/Fixtures/test_public/final-assets');
9797

9898
$this->mappedAssetFactory = $this->createMock(MappedAssetFactoryInterface::class);
9999

src/Symfony/Component/AssetMapper/Tests/Command/AssetMapperCompileCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bundle\FrameworkBundle\Console\Application;
1616
use Symfony\Component\AssetMapper\Event\PreAssetsCompileEvent;
17-
use Symfony\Component\AssetMapper\Tests\fixtures\AssetMapperTestAppKernel;
17+
use Symfony\Component\AssetMapper\Tests\Fixtures\AssetMapperTestAppKernel;
1818
use Symfony\Component\Console\Output\OutputInterface;
1919
use Symfony\Component\Console\Tester\CommandTester;
2020
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -119,7 +119,7 @@ public function testEventIsDispatched()
119119
$listenerCalled = false;
120120
$dispatcher->addListener(PreAssetsCompileEvent::class, function (PreAssetsCompileEvent $event) use (&$listenerCalled) {
121121
$listenerCalled = true;
122-
$this->assertSame(realpath(__DIR__.'/../fixtures').'/public/assets', $event->getOutputDir());
122+
$this->assertSame(realpath(__DIR__.'/../Fixtures').'/public/assets', $event->getOutputDir());
123123
$this->assertInstanceOf(OutputInterface::class, $event->getOutput());
124124
});
125125

src/Symfony/Component/AssetMapper/Tests/Command/DebugAssetsMapperCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bundle\FrameworkBundle\Console\Application;
16-
use Symfony\Component\AssetMapper\Tests\fixtures\AssetMapperTestAppKernel;
16+
use Symfony\Component\AssetMapper\Tests\Fixtures\AssetMapperTestAppKernel;
1717
use Symfony\Component\Console\Tester\CommandTester;
1818

1919
class DebugAssetsMapperCommandTest extends TestCase

0 commit comments

Comments
 (0)