Removed FileClassScannerTest dependency to "Magento_Catalog" #12144
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Code optimization that makes a current test
testClassKeywordInMiddleOfFile
stand on its own since is the only test inFileClassScannerTest
to not include its own test data.Process
Looked at the original error fixed by 4e8d1d6 and reproduced what it needed from app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php
to test for the problem "FileClassScannerTest not liking one case when the word "class" was in a class" as described in commit message 4e8d1d6. Found the problem to only be triggered when string variable interpolation was also being used in the class.
On this basis, the name of the test was changed to
testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing
Motivation behind this change came from experiencing the issue #11230
To test this code
git checkout 4e8d1d612a98cbe35e7782faba5c0609935a1c2a~1
composer install
\Magento\Setup\Test\Unit\Module\Di\Code\Reader\FileClassScannerTest::testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing()
found in 6cf723a945fe7e490fc223b8092ffdc8e3dff910 (the commit from this pull requst) intosetup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php
./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist --filter testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php
)Fixes Issue
Contribution checklist