From c574e4696cee2087f25264fbb7235d0549acdcfa Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:59:42 -0600 Subject: [PATCH] :arrow_double_up: Forwardport of magento/magento2#12144 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/12144.patch (created by @wexo-team) based on commit(s): 1. e046aad7cfe18ebbf5901e3150d36593243b7c8e Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#11230: Unit test fails after fresh installation (reported by @bnymn) --- .../Di/Code/Reader/FileClassScannerTest.php | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php index 72a9bcdc4df72..5bc7fd82b3251 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/Code/Reader/FileClassScannerTest.php @@ -204,13 +204,38 @@ class ThisIsNotMyTest self::assertContains('This\Is\Not\My\Ns\ThisIsNotMyTest', $result); } - public function testClassKeywordInMiddleOfFile() + public function testMultipleClassKeywordsInMiddleOfFileWithStringVariableParsing() { - $filename = __DIR__ - . '/../../../../../../../../../..' - . '/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/AbstractEav.php'; - $filename = realpath($filename); - $scanner = new FileClassScanner($filename); + $scanner = $this->getMockBuilder(FileClassScanner::class)->disableOriginalConstructor()->setMethods([ + 'getFileContents' + ])->getMock(); + $scanner->expects(self::once())->method('getFileContents')->willReturn(<<<'PHP' +doMethod(stdClass::class)->runAction(); + } +} + +PHP + ); + + /* @var $scanner FileClassScanner */ $result = $scanner->getClassNames(); self::assertCount(1, $result);