Skip to content

Commit

Permalink
Merge branch '2.4-develop' of github.com:magento-gl/magento2ce into G…
Browse files Browse the repository at this point in the history
…L_PR_2021-10-05
  • Loading branch information
glo71317 committed Oct 7, 2021
2 parents ae304d4 + 90733ec commit 989b362
Show file tree
Hide file tree
Showing 377 changed files with 1,898 additions and 5,059 deletions.
1 change: 0 additions & 1 deletion Gruntfile.js.sample
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ module.exports = function (grunt) {
prod: function (component) {
var tasks = [
'less',
'autoprefixer',
'cssmin',
'usebanner'
].map(function (task) {
Expand Down
10 changes: 10 additions & 0 deletions app/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@
exit(1);
}

// PHP 8 compatibility. Define constants that are not present in PHP < 8.0
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 80000) {
if (!defined('T_NAME_QUALIFIED')) {
define('T_NAME_QUALIFIED', 24001);
}
if (!defined('T_NAME_FULLY_QUALIFIED')) {
define('T_NAME_FULLY_QUALIFIED', 24002);
}
}

require_once __DIR__ . '/autoload.php';
// Sets default autoload mappings, may be overridden in Bootstrap::create
\Magento\Framework\App\Bootstrap::populateAutoloader(BP, []);
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-config": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"lib-libxml": "*",
"magento/framework": "*",
"magento/module-backend": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedPricingImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-catalog-import-export": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AdvancedSearch/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"magento/module-customer": "*",
"magento/module-search": "*",
"magento/module-store": "*",
"php": "~7.3.0||~7.4.0"
"php": "~7.4.0||~8.0.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Amqp/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/framework": "*",
"magento/framework-amqp": "*",
"magento/framework-message-queue": "*",
"php": "~7.3.0||~7.4.0"
"php": "~7.4.0||~8.0.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AmqpStore/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/framework": "*",
"magento/framework-amqp": "*",
"magento/module-store": "*",
"php": "~7.3.0||~7.4.0"
"php": "~7.4.0||~8.0.0"
},
"suggest": {
"magento/module-asynchronous-operations": "*",
Expand Down
7 changes: 3 additions & 4 deletions app/code/Magento/Analytics/Model/Config/Mapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ public function execute($configData)
$providerData['parameters'] = !empty($providerData['parameters'])
? reset($providerData['parameters'])
: [];
$providerData['parameters'] = array_map(
'reset',
$providerData['parameters']
);
array_walk($providerData['parameters'], function (&$array) {
$array = reset($array);
});
$providers[$providerType] = $providerData;
}
$files[$fileData['name']] = $fileData;
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Analytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-analytics",
"description": "N/A",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/module-backend": "*",
"magento/module-config": "*",
"magento/module-integration": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AsynchronousOperations/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"magento/module-authorization": "*",
"magento/module-backend": "*",
"magento/module-ui": "*",
"php": "~7.3.0||~7.4.0"
"php": "~7.4.0||~8.0.0"
},
"suggest": {
"magento/module-admin-notification": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Authorization/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backend": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/AwsS3/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-remote-storage": "*",
"league/flysystem": "^2.0",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backup": "*",
"magento/module-catalog": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Backup/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-cron": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-catalog": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/BundleGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/module-catalog": "*",
"magento/module-bundle": "*",
"magento/module-graph-ql": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/BundleImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-bundle": "*",
"magento/module-store": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CacheInvalidate/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-page-cache": "*"
},
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Captcha/Test/Unit/Model/DefaultTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class DefaultTest extends TestCase
'case_sensitive' => '0',
'shown_to_logged_in_user' => ['contact_us' => 1],
'always_for' => [
'user_create',
'user_forgotpassword',
'contact_us',
'user_create' => '1',
'user_forgotpassword' => '1',
'contact_us' => '1'
],
];

Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Captcha/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-backend": "*",
"magento/module-checkout": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CardinalCommerce/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-checkout": "*",
"magento/module-payment": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function (array $itemA, array $itemB): int {
$posA = (int)$itemA['position'];
$posB = (int)$itemB['position'];

return $posA <=> $posB;
return (($posA - $posB) > 0) ? 1 : -1; // for PHP 7 and 8 consistency
}
);

Expand Down
3 changes: 1 addition & 2 deletions app/code/Magento/Catalog/Model/ResourceModel/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,9 +518,8 @@ public function getProductsPosition($category)
$websiteId
);
}
$bind = ['category_id' => (int)$category->getId()];

return $this->getConnection()->fetchPairs($select, $bind);
return $this->getConnection()->fetchPairs($select);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ public function getProductsPosition($category)
$websiteId
);
}
$bind = ['category_id' => (int)$category->getId()];

return $this->getConnection()->fetchPairs($select, $bind);
return $this->getConnection()->fetchPairs($select);
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-authorization": "*",
"magento/module-asynchronous-operations": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/module-catalog-analytics",
"description": "N/A",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-analytics": "*"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogCmsGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-cms-graph-ql": "*"
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogCustomerGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-customer": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/module-eav": "*",
"magento/module-catalog": "*",
"magento/module-catalog-inventory": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1607,10 +1607,12 @@ function ($name) use ($throwException, $exception) {
*/
public function testGetProductCategoriesDataSave(array $categoriesData, string $tableName, array $result)
{
$this->_connection->expects($this->at(1))->method('fetchOne')->willReturn('0');
$this->_connection->expects($this->at(3))->method('fetchOne')->willReturn('-2');
$this->skuProcessor->expects($this->at(0))->method('getNewSku')->willReturn(['entity_id' => 2]);
$this->skuProcessor->expects($this->at(1))->method('getNewSku')->willReturn(['entity_id' => 5]);
$this->_connection->method('fetchOne')->willReturnOnConsecutiveCalls('0', '-2');
$this->skuProcessor->method('getNewSku')
->willReturnOnConsecutiveCalls(
['entity_id' => 2],
['entity_id' => 5]
);
$actualResult = $this->invokeMethod(
$this->importProduct,
'getProductCategoriesDataSave',
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogImportExport/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"ext-ctype": "*",
"magento/framework": "*",
"magento/module-catalog": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@

use Magento\CatalogInventory\Model\Config\Backend\Managestock;
use Magento\CatalogInventory\Model\Indexer\Stock\Processor;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class ManagestockTest extends TestCase
{
/**
* @var ScopeConfigInterface|MockObject
*/
private $configMock;

/** @var Processor|MockObject */
protected $stockIndexerProcessor;

Expand All @@ -27,10 +33,15 @@ protected function setUp(): void
Processor::class
)->disableOriginalConstructor()
->getMock();
$this->configMock = $this->getMockBuilder(ScopeConfigInterface::class)
->disableOriginalConstructor()
->getMock();

$this->model = (new ObjectManager($this))->getObject(
Managestock::class,
[
'stockIndexerProcessor' => $this->stockIndexerProcessor,
'config' => $this->configMock,
'stockIndexerProcessor' => $this->stockIndexerProcessor
]
);
}
Expand All @@ -57,6 +68,8 @@ public function testSaveAndRebuildIndex($newStockValue, $callCount)
{
$this->model->setValue($newStockValue);
$this->stockIndexerProcessor->expects($this->exactly($callCount))->method('markIndexerAsInvalid');
$this->configMock->method('getValue')->willReturn(0); // old value for stock status

$this->model->afterSave();
}
}
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventory/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"sort-packages": true
},
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-catalog": "*",
"magento/module-config": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogInventoryGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "N/A",
"type": "magento2-module",
"require": {
"php": "~7.3.0||~7.4.0",
"php": "~7.4.0||~8.0.0",
"magento/framework": "*",
"magento/module-store": "*",
"magento/module-catalog": "*",
Expand Down
Loading

0 comments on commit 989b362

Please sign in to comment.