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

Failing test case duplicated commented elseif on alternative syntax #914

Conversation

samsonasik
Copy link
Contributor

This issue is discovered on Rector issue:

which only printing html+php with if in alternative syntax, it got duplicated commented code.

2) PhpParser\PrettyPrinterTest::testRoundTripPrint with data set "Users/samsonasik/www/PHP-Parser/test/code/prettyPrinter/comments.test#2" ('Comments (/Users/samsonasik/w....test)', '<div class="price-box">\n    ...</div>', '<div class="price-box">\n    ...</div>', null)
Comments (/Users/samsonasik/www/PHP-Parser/test/code/prettyPrinter/comments.test)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
         <span class="price" id="max-product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
             <?php echo Mage::helper('core')->currency($_max,true,false) ?>
         </span>
+    <?php */<?php /*elseif ($_max = $this->getMaxAmount()): ?>
+        <span class="label"><?php echo Mage::helper('brainvire_giftcard')->__('Up To') ?></span>
+        <span class="price" id="max-product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
+            <?php echo Mage::helper('core')->currency($_max,true,false) ?>
+        </span>
     <?php */endif; ?>

Ref https://getrector.com/demo/06f6b4b3-883a-4f6d-9528-246001d66734

@nikic
Copy link
Owner

nikic commented Mar 5, 2023

It looks like this is fixed on master by 9b46dff.

@samsonasik
Copy link
Contributor Author

The fix commit is on Sep 11, 2022, this PR I created from 2 weeks ago, which already latest master

@samsonasik
Copy link
Contributor Author

Oh, I see, I use 4.x branch, could the fix included in 4.x release?

@nikic
Copy link
Owner

nikic commented Mar 5, 2023

Cherry-picked to 4.x in cad49f8.

@nikic nikic closed this Mar 5, 2023
@samsonasik samsonasik deleted the duplicate-commented-elseif-alternative-syntax branch March 5, 2023 19:48
@nikic
Copy link
Owner

nikic commented Mar 5, 2023

And released.

@samsonasik
Copy link
Contributor Author

@nikic thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants