diff --git a/app/code/Magento/Catalog/etc/di.xml b/app/code/Magento/Catalog/etc/di.xml index 4b4e0b17fe25..2ba1898629e7 100644 --- a/app/code/Magento/Catalog/etc/di.xml +++ b/app/code/Magento/Catalog/etc/di.xml @@ -1,8 +1,8 @@ @@ -73,7 +73,6 @@ - diff --git a/app/code/Magento/Directory/Model/AllowedCountries.php b/app/code/Magento/Directory/Model/AllowedCountries.php index 69326439edc0..dfac85e3f97b 100644 --- a/app/code/Magento/Directory/Model/AllowedCountries.php +++ b/app/code/Magento/Directory/Model/AllowedCountries.php @@ -1,7 +1,7 @@ - - www.google-analytics.com - analytics.google.com + + *.google-analytics.com + *.analytics.google.com www.googletagmanager.com @@ -32,12 +32,12 @@ - - - + + + - www.google-analytics.com - analytics.google.com + *.google-analytics.com + *.analytics.google.com www.googletagmanager.com diff --git a/app/code/Magento/RemoteStorage/etc/di.xml b/app/code/Magento/RemoteStorage/etc/di.xml index 130ed0f65634..802bac5df2dc 100644 --- a/app/code/Magento/RemoteStorage/etc/di.xml +++ b/app/code/Magento/RemoteStorage/etc/di.xml @@ -1,15 +1,14 @@ - diff --git a/app/etc/di.xml b/app/etc/di.xml index b86a567b1159..385518fd79a2 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -1,8 +1,8 @@ @@ -82,7 +82,6 @@ - diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 6fa4da23663f..4ad7b3797ac5 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -1,13 +1,13 @@ [, ]) * * @codingStandardsIgnoreFile - * - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. */ return [ ['Mage_Admin_Helper_Data', 'Magento\Backend\Helper\Data'], @@ -2845,7 +2845,7 @@ ['Magento\Framework\Stdlib\CookieManager', 'Magento\Framework\Stdlib\CookieManagerInterface'], ['Magento\Framework\Interception\PluginList', 'Magento\Framework\Interception\PluginListInterface'], ['Magento\Framework\Interception\Config', 'Magento\Framework\Interception\ConfigInterface'], - ['Magento\Framework\Interception\Chain', 'Magento\Framework\Interception\ChainInterface'], + ['Magento\Framework\Interception\Chain'], ['Magento\Framework\Interception\Definition', 'Magento\Framework\Interception\DefinitionInterface'], ['Magento\Framework\ObjectManager\Factory', 'Magento\Framework\ObjectManager\FactoryInterface'], ['Magento\Framework\ObjectManager\Config', 'Magento\Framework\ObjectManager\ConfigInterface'], diff --git a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php index 8f40ab044c02..52fac681eca0 100644 --- a/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php +++ b/lib/internal/Magento/Framework/Css/PreProcessor/Adapter/Less/Processor.php @@ -1,10 +1,12 @@ logger = $logger; $this->appState = $appState; $this->assetSource = $assetSource; $this->temporaryFile = $temporaryFile; + $this->directoryList = $directoryList ?: ObjectManager::getInstance()->get(DirectoryList::class); } /** @@ -66,10 +78,19 @@ public function processContent(File $asset) { $path = $asset->getPath(); try { + $mode = $this->appState->getMode(); + $sourceMapBasePath = sprintf( + '%s/pub/', + $this->directoryList->getPath(DirectoryList::TEMPLATE_MINIFICATION_DIR), + ); + $parser = new \Less_Parser( [ 'relativeUrls' => false, - 'compress' => $this->appState->getMode() !== State::MODE_DEVELOPER + 'compress' => $mode !== State::MODE_DEVELOPER, + 'sourceMap' => $mode === State::MODE_DEVELOPER, + 'sourceMapRootpath' => '/', + 'sourceMapBasepath' => $sourceMapBasePath, ] ); diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php index 4e50808ea021..06328c1f73a2 100644 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/ProcessorTest.php @@ -1,12 +1,13 @@ temporaryFileMock = $this->getMockBuilder(Temporary::class) ->disableOriginalConstructor() ->getMock(); + $this->directoryListMock = $this->getMockBuilder(DirectoryList::class) + ->disableOriginalConstructor() + ->getMock(); $this->processor = new Processor( $this->loggerMock, $this->appStateMock, $this->assetSourceMock, - $this->temporaryFileMock + $this->temporaryFileMock, + $this->directoryListMock, ); } @@ -89,7 +98,7 @@ public function testProcessContentException() $this->appStateMock->expects(self::once()) ->method('getMode') - ->willReturn(State::MODE_DEVELOPER); + ->willReturn(State::MODE_PRODUCTION); $this->assetSourceMock->expects(self::once()) ->method('getContent') @@ -120,7 +129,7 @@ public function testProcessContentEmpty() $this->appStateMock->expects(self::once()) ->method('getMode') - ->willReturn(State::MODE_DEVELOPER); + ->willReturn(State::MODE_PRODUCTION); $this->assetSourceMock->expects(self::once()) ->method('getContent') @@ -141,12 +150,55 @@ public function testProcessContentEmpty() } /** - * Test for processContent method (not empty content) + * Test for processContent method in production mode (not empty content) */ public function testProcessContentNotEmpty() { $assetMock = $this->getAssetMock(); + $this->appStateMock->expects(self::once()) + ->method('getMode') + ->willReturn(State::MODE_PRODUCTION); + + $this->assetSourceMock->expects(self::once()) + ->method('getContent') + ->with($assetMock) + ->willReturn(self::TEST_CONTENT); + + $this->temporaryFileMock->expects(self::once()) + ->method('createFile') + ->with(self::ASSET_PATH, self::TEST_CONTENT) + ->willReturn(__DIR__ . '/' . self::TMP_PATH_LESS); + + $assetMock->expects(self::once()) + ->method('getPath') + ->willReturn(self::ASSET_PATH); + + $this->loggerMock->expects(self::never()) + ->method('critical'); + + $clearSymbol = ["\n", "\r", "\t", ' ']; + self::assertEquals( + trim(str_replace( + $clearSymbol, + '', + file_get_contents(__DIR__ . '/' . self::TMP_PATH_CSS_PRODUCTION) + )), + trim(str_replace( + $clearSymbol, + '', + $this->processor->processContent($assetMock) + )) + ); + } + + /** + * Test for processContent method in developer mode (not empty content) + */ + public function testProcessContentNotEmptyInDeveloperMode() + { + $assetMock = $this->getAssetMock(); + $this->appStateMock->expects(self::once()) ->method('getMode') ->willReturn(State::MODE_DEVELOPER); @@ -170,8 +222,16 @@ public function testProcessContentNotEmpty() $clearSymbol = ["\n", "\r", "\t", ' ']; self::assertEquals( - trim(str_replace($clearSymbol, '', file_get_contents(__DIR__ . '/' . self::TMP_PATH_CSS))), - trim(str_replace($clearSymbol, '', $this->processor->processContent($assetMock))) + trim(str_replace( + $clearSymbol, + '', + file_get_contents(__DIR__ . '/' . self::TMP_PATH_CSS_DEVELOPER) + )), + trim(str_replace( + $clearSymbol, + '', + $this->normalizeInlineSourceMap($this->processor->processContent($assetMock)) + )) ); } @@ -186,4 +246,34 @@ private function getAssetMock() return $assetMock; } + + /** + * - find json part of sourcemap + * - url decode it + * - replace \/ with / in source filenames + * - remove absolute path in filename, make it a relative path + */ + private function normalizeInlineSourceMap(string $css): string + { + $regexBegin = 'sourceMappingURL=data:application/json,'; + $regexEnd = '*/'; + $regex = '@' . preg_quote($regexBegin, '@') . '([^\*]+)' . preg_quote($regexEnd, '@') . '@'; + + if (preg_match($regex, $css, $matches) === 1) { + $inlineSourceMapJson = $matches[1]; + $inlineSourceMapJson = urldecode($inlineSourceMapJson); + $inlineSourceMapJson = json_decode($inlineSourceMapJson, true, 512, JSON_UNESCAPED_SLASHES); + + $relativeFilenames = []; + foreach ($inlineSourceMapJson['sources'] as $filename) { + $relativeFilenames[] = str_replace(sprintf('%s/', BP), '', $filename); + } + $inlineSourceMapJson['sources'] = $relativeFilenames; + $inlineSourceMapJson = json_encode($inlineSourceMapJson, JSON_UNESCAPED_SLASHES); + + $css = preg_replace($regex, sprintf('%s%s%s', $regexBegin, $inlineSourceMapJson, $regexEnd), $css); + } + + return $css; + } } diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-developer.css b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-developer.css new file mode 100644 index 000000000000..41ebde913043 --- /dev/null +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-developer.css @@ -0,0 +1,20 @@ +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +body { + background: #333333; + color: #454545; +} +a { + color: #ff9900; +} +h1, +h2, +h3, +h4, +h5, +h6 { + color: #333333; +} +/*#sourceMappingURL=data:application/json,{"version":3,"sources":["lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test.less"],"names":[],"mappings":";;;;AASA;EACE,mBAAA;EACA,cAAA;;AAEF;EACE,cAAA;;AAEF;AAAI;AAAI;AAAI;AAAI;AAAI;EAClB,cAAA"}*/ diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-production.css b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-production.css new file mode 100644 index 000000000000..f8236f0d9740 --- /dev/null +++ b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test-production.css @@ -0,0 +1,15 @@ +body { + background: #333333; + color: #454545 +} +a { + color: #ff9900 +} +h1, +h2, +h3, +h4, +h5, +h6 { + color: #333333 +} diff --git a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test.css b/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test.css deleted file mode 100644 index d6eaa03c1030..000000000000 --- a/lib/internal/Magento/Framework/Css/Test/Unit/PreProcessor/Adapter/Less/_file/test.css +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ -body { - background: #333333; - color: #454545; -} -a { - color: #ff9900; -} -h1, -h2, -h3, -h4, -h5, -h6 { - color: #333333; -} diff --git a/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php b/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php index bf72d8b04ff1..53f36cf08b3a 100644 --- a/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php +++ b/lib/internal/Magento/Framework/Webapi/Rest/Request/Deserializer/Xml.php @@ -1,7 +1,7 @@ parserFactory->create(); $xmlParser->loadXML($xmlRequestBody); - restore_error_handler(); - if (isset($previousLoaderState)) { - libxml_disable_entity_loader($previousLoaderState); - } /** Process errors during XML parsing. */ if ($this->_errorMessage !== null) { diff --git a/lib/internal/Magento/Framework/Xml/Security.php b/lib/internal/Magento/Framework/Xml/Security.php index 8d125736c6d3..8934a7c126c8 100644 --- a/lib/internal/Magento/Framework/Xml/Security.php +++ b/lib/internal/Magento/Framework/Xml/Security.php @@ -1,7 +1,7 @@ writeln($line); } + // we must have an exit code higher than zero to indicate something was wrong return Cli::RETURN_FAILURE; } @@ -224,6 +224,7 @@ function (OperationInterface $operation) use ($progressBar) { // we must have an exit code higher than zero to indicate something was wrong return Cli::RETURN_FAILURE; } + return Cli::RETURN_SUCCESS; } @@ -231,6 +232,7 @@ function (OperationInterface $operation) use ($progressBar) { * Build list of module path regexps which should be excluded from compilation * * @param string[] $modulePaths + * * @return string[] */ private function getExcludedModulePaths(array $modulePaths) @@ -251,6 +253,7 @@ private function getExcludedModulePaths(array $modulePaths) $vendorPathsRegExps[] = $vendorDir . '/(?:' . join('|', $vendorModules) . ')'; } + $basePathsRegExps[] = preg_quote($basePath, '#') . '/(?:' . join('|', $vendorPathsRegExps) . ')'; } @@ -266,6 +269,7 @@ private function getExcludedModulePaths(array $modulePaths) * Build list of library path regexps which should be excluded from compilation * * @param string[] $libraryPaths + * * @return string[] */ private function getExcludedLibraryPaths(array $libraryPaths) @@ -288,6 +292,7 @@ function ($libraryPath) { * Get excluded setup application paths * * @param string $setupPath + * * @return string[] */ private function getExcludedSetupPaths($setupPath) @@ -301,6 +306,7 @@ private function getExcludedSetupPaths($setupPath) * Delete directories by their code from "var" directory * * @param array $directoryCodeList + * * @return void */ private function cleanupFilesystem($directoryCodeList) @@ -314,6 +320,7 @@ private function cleanupFilesystem($directoryCodeList) * Configure Object Manager * * @param OutputInterface $output + * * @return void */ private function configureObjectManager(OutputInterface $output) @@ -365,6 +372,7 @@ private function configureObjectManager(OutputInterface $output) * Returns operations configuration * * @param array $compiledPathsList + * * @return array */ private function getOperationsConfiguration( @@ -399,6 +407,7 @@ private function getOperationsConfiguration( OperationFactory::AREA_CONFIG_GENERATOR => [ $compiledPathsList['application'], $compiledPathsList['library'], + $compiledPathsList['setup'], $compiledPathsList['generated_helpers'], ], OperationFactory::INTERCEPTION_CACHE => [ diff --git a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php index 86a377c8edc6..af572c261efc 100644 --- a/setup/src/Magento/Setup/Model/PhpReadinessCheck.php +++ b/setup/src/Magento/Setup/Model/PhpReadinessCheck.php @@ -1,7 +1,7 @@ checkXDebugNestedLevel(), - $this->checkPopulateRawPostSetting(), $this->checkFunctionsExistence() ); @@ -270,52 +269,6 @@ private function checkXDebugNestedLevel() return $data; } - /** - * Checks if PHP version >= 5.6.0 and always_populate_raw_post_data is set to -1 - * - * Beginning PHP 7.0, support for 'always_populate_raw_post_data' is going to removed. - * And beginning PHP 5.6, a deprecated message is displayed if 'always_populate_raw_post_data' - * is set to a value other than -1. - * - * @return array - */ - private function checkPopulateRawPostSetting() - { - // HHVM and PHP 7does not support 'always_populate_raw_post_data' to be set to -1 - if (version_compare(PHP_VERSION, '7.0.0-beta') >= 0 || defined('HHVM_VERSION')) { - return []; - } - - $data = []; - $error = false; - $iniSetting = (int)ini_get('always_populate_raw_post_data'); - - $checkVersionConstraint = $this->versionParser->parseConstraints('~5.6.0'); - $normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION); - $currentVersion = $this->versionParser->parseConstraints($normalizedPhpVersion); - if ($checkVersionConstraint->matches($currentVersion) && $iniSetting !== -1) { - $error = true; - } - - $message = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = %d. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION, - (int)ini_get('always_populate_raw_post_data') - ); - - $data['always_populate_raw_post_data'] = [ - 'message' => $message, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => $error - ]; - - return $data; - } - /** * Check whether all special functions exists * diff --git a/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php b/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php index f6138d8be303..ecab20b26857 100644 --- a/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php +++ b/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php @@ -1,19 +1,15 @@ classesScanner->getList($path) as $className) { - $classes[$className] = $this->classReaderDecorator->getConstructor($className); + $classes[$className] = (array) $this->classReaderDecorator->getConstructor($className); } return $classes; diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php b/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php index 7a6d34fbcbe0..d970094510e6 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php @@ -1,8 +1,7 @@ diContainerConfig->getArguments($instanceType); return array_map( function ($type) { - if (isset($type['instance'])) { + if (is_object($type)) { + return; + } + + if (is_array($type) && isset($type['instance'])) { $type['instance'] = ltrim($type['instance'], '\\'); } diff --git a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php index 79441b2f3eac..ea22b7259229 100644 --- a/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php +++ b/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php @@ -1,13 +1,15 @@ getInstancesNamesList() as $instanceName) { $preference = $areaConfig->getPreference($instanceName); if ($instanceName !== $preference) { + if (array_key_exists($preference, $areaConfig->getVirtualTypes())) { + // Special handling is required for virtual types. + $config['preferences'][$instanceName] = $preference; + continue; + } + + if (!class_exists($preference)) { + throw new LocalizedException(new Phrase( + 'Preference declared for "%instanceName" as "%preference", but the latter does not exist.', + [ + 'instanceName' => $instanceName, + 'preference' => $preference, + ] + )); + } + + // Classes defined by PHP extensions are allowed. + $reflection = new \ReflectionClass($preference); + if ($reflection->getExtension()) { + $config['preferences'][$instanceName] = $preference; + continue; + } + + if (!$definitionsCollection->hasInstance($preference)) { + // See 'excludePatterns' in Magento\Setup\Module\Di\Code\Reader\ClassesScanner, + // populated via Magento\Setup\Console\Command\DiCompileCommand + throw new LocalizedException(new Phrase( + 'Preference declared for "%instanceName" as "%preference", but the latter' + . ' has not been included in dependency injection compilation.', + [ + 'instanceName' => $instanceName, + 'preference' => $preference, + ] + )); + } + $config['preferences'][$instanceName] = $preference; } } diff --git a/setup/src/Magento/Setup/Module/Di/Definition/Collection.php b/setup/src/Magento/Setup/Module/Di/Definition/Collection.php index 559cafbb4491..3cce8b167281 100644 --- a/setup/src/Magento/Setup/Module/Di/Definition/Collection.php +++ b/setup/src/Magento/Setup/Module/Di/Definition/Collection.php @@ -1,7 +1,7 @@ definitions[$instanceName]); + return array_key_exists($instanceName, $this->definitions); } } diff --git a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php index 919b16c20140..088a42025690 100644 --- a/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Model/PhpReadinessCheckTest.php @@ -1,7 +1,7 @@ ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'data' => [ @@ -267,14 +259,6 @@ public function testCheckPhpSettings(): void ] ] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data']['always_populate_raw_post_data'] = [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ]; - } $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); } @@ -293,14 +277,6 @@ public function testCheckPhpSettingsFailed(): void 200 ); - $rawPostMessage = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = -1. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION - ); $expected = [ 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, 'data' => [ @@ -315,14 +291,6 @@ public function testCheckPhpSettingsFailed(): void ] ] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data']['always_populate_raw_post_data'] = [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ]; - } $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpSettings()); } @@ -333,28 +301,10 @@ public function testCheckPhpSettingsNoXDebug(): void { $this->phpInfo->expects($this->once())->method('getCurrent')->willReturn([]); - $rawPostMessage = sprintf( - 'Your PHP Version is %s, but always_populate_raw_post_data = -1. - $HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will be removed in PHP 7.0. - This will stop the installer from running. - Please open your php.ini file and set always_populate_raw_post_data to -1. - If you need more help please call your hosting provider.', - PHP_VERSION - ); $expected = [ 'responseType' => ResponseTypeInterface::RESPONSE_TYPE_SUCCESS, 'data' => [] ]; - if (!$this->isPhp7OrHhvm()) { - $this->setUpNoPrettyVersionParser(); - $expected['data'] = [ - 'always_populate_raw_post_data' => [ - 'message' => $rawPostMessage, - 'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data', - 'error' => false - ] - ]; - } $expected['data']['missed_function_imagecreatefromjpeg'] = [ 'message' => 'You must have installed GD library with --with-jpeg-dir=DIR option.', @@ -453,14 +403,6 @@ public function testCheckPhpExtensionsFailed(): void ]; $this->assertEquals($expected, $this->phpReadinessCheck->checkPhpExtensions()); } - - /** - * @return bool - */ - protected function isPhp7OrHhvm(): bool - { - return version_compare(PHP_VERSION, '7.0.0-beta') >= 0 || defined('HHVM_VERSION'); - } } namespace Magento\Setup\Model; @@ -473,8 +415,6 @@ function ini_get($param) { if ($param === 'xdebug.max_nesting_level') { return 100; - } elseif ($param === 'always_populate_raw_post_data') { - return -1; } elseif ($param === 'memory_limit') { return '512M'; } diff --git a/setup/src/Magento/Setup/Test/Unit/Module/Di/Compiler/Config/ReaderTest.php b/setup/src/Magento/Setup/Test/Unit/Module/Di/Compiler/Config/ReaderTest.php index 0e5a57cfcfa5..964764259316 100644 --- a/setup/src/Magento/Setup/Test/Unit/Module/Di/Compiler/Config/ReaderTest.php +++ b/setup/src/Magento/Setup/Test/Unit/Module/Di/Compiler/Config/ReaderTest.php @@ -1,7 +1,7 @@ 'ConcreteType1', - 'ThirdPartyInterface' => 'ConcreteType2' + 'Interface1' => 'DateTime', + 'ThirdPartyInterface' => 'DateTimeZone', ]; } @@ -187,8 +187,8 @@ private function getPreferencesMap() return [ ['ConcreteType1', 'ConcreteType1'], ['ConcreteType2', 'ConcreteType2'], - ['Interface1', 'ConcreteType1'], - ['ThirdPartyInterface', 'ConcreteType2'] + ['Interface1', 'DateTime'], + ['ThirdPartyInterface', 'DateTimeZone'], ]; }