Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Nov 1, 2023
1 parent ebbe2df commit 14a557a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function testGetControllersMap()
return new MappedAsset($path, '/path/to'.$path);
});
} else {
// @legacy for AssetMapper 6.3
$autoImportLocator->expects($this->never())
->method('locateAsset');
}
Expand Down Expand Up @@ -92,6 +93,11 @@ public function testGetControllersMap()
$this->assertSame('fake-vendor/ux-package1/package-controller-second.js', $controllerSecond->asset->logicalPath);
// lazy from user's controller.json
$this->assertTrue($controllerSecond->isLazy);
// @legacy: assert can be without the conditional for AssetMapper 6.4+
if (class_exists(ImportMapConfigReader::class)) {
// 4 auto imports from package.json
$this->assertCount(4, $controllerSecond->autoImports);
}
$this->assertCount(4, $controllerSecond->autoImports);

$helloControllerFromPackage = $map['fake-vendor--ux-package2--hello-controller'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,23 @@

use PHPUnit\Framework\TestCase;
use Symfony\Component\AssetMapper\AssetMapperInterface;
use Symfony\Component\AssetMapper\ImportMap\ImportMapConfigReader;
use Symfony\Component\AssetMapper\MappedAsset;
use Symfony\UX\StimulusBundle\AssetMapper\ControllersMapGenerator;
use Symfony\UX\StimulusBundle\Twig\UxControllersTwigRuntime;
use Symfony\UX\StimulusBundle\Ux\UxPackageReader;

class UxControllersTwigRuntimeTest extends TestCase
{
/**
* @group legacy
*/
public function testRenderLinkTags()
{
if (class_exists(ImportMapConfigReader::class)) {
$this->markTestSkipped('Skip test for AssetMapper 6.4+');
}

$controllersMapGenerator = $this->createMock(ControllersMapGenerator::class);
$controllersMapGenerator->expects($this->any())
->method('getControllersJsonPath')
Expand Down

0 comments on commit 14a557a

Please sign in to comment.