Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.4-develop' into improve-grap…
Browse files Browse the repository at this point in the history
…hql-stitching-perf

 Conflicts:
	lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader.php
  • Loading branch information
convenient committed Oct 8, 2021
2 parents 459cbbe + 90733ec commit 603963e
Show file tree
Hide file tree
Showing 1,789 changed files with 50,167 additions and 34,455 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For more detailed information on contribution please read our [beginners guide](

1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
2. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/2.3-develop/.github/PULL_REQUEST_TEMPLATE.md) for more information.
3. Commits must be accompanied by meaningful commit messages. Please see the [Magento Pull Request Template](https://github.com/magento/magento2/blob/HEAD/.github/PULL_REQUEST_TEMPLATE.md) for more information.
4. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
3. PRs which include new logic or new features must be submitted along with:
* Unit/integration test coverage
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ atlassian*
/package.json
/.php_cs
/.php_cs.cache
/.php-cs-fixer.php
/.php-cs-fixer.cache
/grunt-config.json
/pub/media/*.*
!/pub/media/.htaccess
Expand Down
9 changes: 5 additions & 4 deletions .php_cs.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@
->exclude('setup/vendor')
->exclude('var');

return PhpCsFixer\Config::create()
->setFinder($finder)
$config = new PhpCsFixer\Config();
$config->setFinder($finder)
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'concat_space' => ['spacing' => 'one'],
'include' => true,
'new_with_braces' => true,
'no_empty_statement' => true,
'no_extra_consecutive_blank_lines' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_multiline_whitespace_around_double_arrow' => true,
'no_multiline_whitespace_before_semicolons' => true,
'multiline_whitespace_before_semicolons' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unused_imports' => true,
Expand All @@ -44,3 +44,4 @@
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
]);
return $config;
13 changes: 7 additions & 6 deletions Gruntfile.js.sample
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ module.exports = function (grunt) {
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
themes;

filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
themes = filesRouter.get('themes');
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
themes = filesRouter.get('themes');

tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
tasks = _.map(tasks, function (task) {
return task.replace('.js', '');
});
tasks.push('time-grunt');
tasks.forEach(function (task) {
require(task)(grunt);
Expand Down Expand Up @@ -50,10 +52,9 @@ module.exports = function (grunt) {
prod: function (component) {
var tasks = [
'less',
'autoprefixer',
'cssmin',
'usebanner'
].map(function(task){
].map(function (task) {
return task + ':' + component;
});

Expand All @@ -72,7 +73,7 @@ module.exports = function (grunt) {
'clean',
'exec:all'
];
_.each(themes, function(theme, name) {
_.each(themes, function (theme, name) {
tasks.push('less:' + name);
});
grunt.task.run(tasks);
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
75 changes: 52 additions & 23 deletions app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,42 +28,69 @@
*/
class FeedTest extends TestCase
{
/** @var Feed */
/**
* @var Feed
*/
protected $feed;

/** @var ObjectManagerHelper */
/**
* @var ObjectManagerHelper
*/
protected $objectManagerHelper;

/** @var InboxFactory|MockObject */
/**
* @var InboxFactory|MockObject
*/
protected $inboxFactory;

/** @var Inbox|MockObject */
/**
* @var Inbox|MockObject
*/
protected $inboxModel;

/** @var CurlFactory|MockObject */
/**
* @var CurlFactory|MockObject
*/
protected $curlFactory;

/** @var Curl|MockObject */
/**
* @var Curl|MockObject
*/
protected $curl;

/** @var ConfigInterface|MockObject */
/**
* @var ConfigInterface|MockObject
*/
protected $backendConfig;

/** @var CacheInterface|MockObject */
/**
* @var CacheInterface|MockObject
*/
protected $cacheManager;

/** @var State|MockObject */
/**
* @var State|MockObject
*/
protected $appState;

/** @var DeploymentConfig|MockObject */
/**
* @var DeploymentConfig|MockObject
*/
protected $deploymentConfig;

/** @var ProductMetadata|MockObject */
/**
* @var ProductMetadata|MockObject
*/
protected $productMetadata;

/** @var UrlInterface|MockObject */
/**
* @var UrlInterface|MockObject
*/
protected $urlBuilder;

/**
* @inheritDoc
*/
protected function setUp(): void
{
$this->inboxFactory = $this->createPartialMock(
Expand Down Expand Up @@ -97,11 +124,8 @@ protected function setUp(): void
);

$this->deploymentConfig = $this->createMock(DeploymentConfig::class);

$this->objectManagerHelper = new ObjectManagerHelper($this);

$this->productMetadata = $this->createMock(ProductMetadata::class);

$this->urlBuilder = $this->getMockForAbstractClass(UrlInterface::class);

$this->feed = $this->objectManagerHelper->getObject(
Expand All @@ -120,11 +144,13 @@ protected function setUp(): void
}

/**
* @dataProvider checkUpdateDataProvider
* @param bool $callInbox
* @param string $curlRequest
*
* @return void
* @dataProvider checkUpdateDataProvider
*/
public function testCheckUpdate($callInbox, $curlRequest)
public function testCheckUpdate(bool $callInbox, string $curlRequest): void
{
$mockName = 'Test Product Name';
$mockVersion = '0.0.0';
Expand All @@ -144,16 +170,19 @@ public function testCheckUpdate($callInbox, $curlRequest)

$lastUpdate = 0;
$this->cacheManager->expects($this->once())->method('load')->willReturn($lastUpdate);
$this->curlFactory->expects($this->at(0))->method('create')->willReturn($this->curl);
$this->curlFactory
->method('create')
->willReturn($this->curl);
$this->curl->expects($this->once())->method('setConfig')->with($configValues)->willReturnSelf();
$this->curl->expects($this->once())->method('read')->willReturn($curlRequest);
$this->backendConfig->expects($this->at(0))->method('getValue')->willReturn('1');
$this->backendConfig->expects($this->once())->method('isSetFlag')->willReturn(false);
$this->backendConfig->expects($this->at(1))->method('getValue')
->willReturn('http://feed.magento.com');
$this->backendConfig
->method('getValue')
->willReturnOnConsecutiveCalls('1', 'http://feed.magento.com');
$this->deploymentConfig->expects($this->once())->method('get')
->with(ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE)
->willReturn('Sat, 6 Sep 2014 16:46:11 UTC');

if ($callInbox) {
$this->inboxFactory->expects($this->once())->method('create')
->willReturn($this->inboxModel);
Expand Down Expand Up @@ -188,7 +217,7 @@ function ($initialValue, $item) use ($data) {
/**
* @return array
*/
public function checkUpdateDataProvider()
public function checkUpdateDataProvider(): array
{
return [
[
Expand Down Expand Up @@ -246,7 +275,7 @@ public function checkUpdateDataProvider()
</channel>
</rss>'
// @codingStandardsIgnoreEnd
],
]
];
}
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
<div class="message-system-short">
<button class="message-system-action-dropdown" toggleCollapsible>
<span>
<translate args="'System Messages'"/>:
<text args="totalRecords"/>
<translate args="'System Messages'"></translate>:
<text args="totalRecords"></text>
</span>
</button>
<div class="message-system-short-wrapper" if="rows[0]" repeat="foreach: [rows[0]], item: '$row'" visible="!$collapsible.opened()">
<fastForEach args="data: getVisible(), as: '$col'" >
<render args="$col.getBody()"/>
<render args="$col.getBody()"></render>
</fastForEach>
</div>
</div>
<div class="message-system-collapsible">
<ul class="message-system-list">
<li repeat="foreach: rows, item: '$row'">
<fastForEach args="data: getVisible(), as: '$col'" >
<render args="$col.getBody()"/>
<render args="$col.getBody()"></render>
</fastForEach>
</li>
</ul>
Expand Down
Loading

0 comments on commit 603963e

Please sign in to comment.