Skip to content

Commit 14a557a

Browse files
committed
fixing tests
1 parent ebbe2df commit 14a557a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/StimulusBundle/tests/AssetMapper/ControllerMapGeneratorTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public function testGetControllersMap()
5353
return new MappedAsset($path, '/path/to'.$path);
5454
});
5555
} else {
56+
// @legacy for AssetMapper 6.3
5657
$autoImportLocator->expects($this->never())
5758
->method('locateAsset');
5859
}
@@ -92,6 +93,11 @@ public function testGetControllersMap()
9293
$this->assertSame('fake-vendor/ux-package1/package-controller-second.js', $controllerSecond->asset->logicalPath);
9394
// lazy from user's controller.json
9495
$this->assertTrue($controllerSecond->isLazy);
96+
// @legacy: assert can be without the conditional for AssetMapper 6.4+
97+
if (class_exists(ImportMapConfigReader::class)) {
98+
// 4 auto imports from package.json
99+
$this->assertCount(4, $controllerSecond->autoImports);
100+
}
95101
$this->assertCount(4, $controllerSecond->autoImports);
96102

97103
$helloControllerFromPackage = $map['fake-vendor--ux-package2--hello-controller'];

src/StimulusBundle/tests/Twig/UxControllersTwigRuntimeTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\AssetMapper\AssetMapperInterface;
16+
use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
1617
use Symfony\Component\AssetMapper\MappedAsset;
1718
use Symfony\UX\StimulusBundle\AssetMapper\ControllersMapGenerator;
1819
use Symfony\UX\StimulusBundle\Twig\UxControllersTwigRuntime;
1920
use Symfony\UX\StimulusBundle\Ux\UxPackageReader;
2021

2122
class UxControllersTwigRuntimeTest extends TestCase
2223
{
24+
/**
25+
* @group legacy
26+
*/
2327
public function testRenderLinkTags()
2428
{
29+
if (class_exists(ImportMapConfigReader::class)) {
30+
$this->markTestSkipped('Skip test for AssetMapper 6.4+');
31+
}
32+
2533
$controllersMapGenerator = $this->createMock(ControllersMapGenerator::class);
2634
$controllersMapGenerator->expects($this->any())
2735
->method('getControllersJsonPath')

0 commit comments

Comments
 (0)