Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[StimulusBundle] Handles Windows directory separator when normalizing controller names #1444

Merged
merged 1 commit into from Feb 1, 2024

Conversation

tamcy
Copy link
Contributor

@tamcy tamcy commented Feb 1, 2024

Q A
Bug fix? yes
New feature? no
Issues Fix #1422
License MIT

This fixes the issue that controller name normalization doesn't work as intended in Windows which uses \ as the directory separator. In fact, without the fix, PHPUnit fails when running on Windows platform with the following error:

1) Symfony\UX\StimulusBundle\Tests\AssetMapper\ControllerMapGeneratorTest::testGetControllersMap
Failed asserting that two arrays are identical.
--- Expected
+++ Actual
@@ @@
     4 => 'hello-with-dashes'
     5 => 'hello-with-underscores'
     6 => 'other'
-    7 => 'subdir--deeper'
-    8 => 'subdir--deeper-with-dashes'
-    9 => 'subdir--deeper-with-underscores'
+    7 => 'subdir\deeper'
+    8 => 'subdir\deeper-with-dashes'
+    9 => 'subdir\deeper-with-underscores'
     10 => 'typescript'
 )

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Feb 1, 2024
@weaverryan
Copy link
Member

Thanks for this excellent PR @tamcy!

@weaverryan weaverryan merged commit c10f602 into symfony:2.x Feb 1, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[StimulusBundle] AssetMapper compiler doesn't handle controllers in subdirectory correctly
3 participants