Skip to content

Commit

Permalink
🔃 [Magento Community Engineering] Community Contributions - 2.3-devel…
Browse files Browse the repository at this point in the history
…op latest changes

Accepted Community Pull Requests:
 - #25024: Quality Assurance > Missing PHPDoc comment (by @lfluvisotto)
 - #25034: Resolve "New Accounts Report" should disable the sort ability of "New Account" columns (because it can not run) #25033 (by @edenduong)
 - #24959: Fix for #23577. Check if db tables for config data exists before fetch (by @ivan-koliadynskyy)
 - #24899: Static Content Deploy - Add command line argument to disable JS Bundles (by @andrey-legayev)
 - #24898: DI Compile - Sort DI metadata output to make diff between builds easier (by @andrey-legayev)
 - #24345: Sales - fix displaying available allowed countries while editing order address in Admin panel (by @oleksii-lisovyi)
 - #24981: Fixed required class is missing in load template (by @gauravagarwal1001)
 - #25064: Updated strings and XML comments. (by @sanganinamrata)


Fixed GitHub Issues:
 - #25033: "New Accounts Report" should disable the sort ability of "New Account" columns (because it can not run) (reported by @edenduong) has been fixed in #25034 by @edenduong in 2.3-develop branch
   Related commits:
     1. f68dd1c

 - #23577: Since 2.3.2, we can no longer switch maintenance modes with an empty database (reported by @hostep) has been fixed in #24959 by @ivan-koliadynskyy in 2.3-develop branch
   Related commits:
     1. 813f1d7
     2. c252363
     3. 9e88279
     4. ee6e8a6
     5. 20e46ff
     6. 55a5748
     7. 0a083be
     8. c579195

 - #12560: Back-End issue for multi-store website: when editing Order shipping/billing address - allowed countries are selected from wrong Store View   (reported by @svejegres) has been fixed in #24345 by @oleksii-lisovyi in 2.3-develop branch
   Related commits:
     1. d617c3c
     2. 883d9f5
  • Loading branch information
magento-engcom-team authored Oct 18, 2019
2 parents b169e62 + 4f91401 commit abbfa03
Show file tree
Hide file tree
Showing 40 changed files with 668 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public function testGetSolutionIdSandbox($environment, $expectedSolution)
$this->assertEquals($expectedSolution, $this->model->getSolutionId(123));
}

/**
* @return array
*/
public function configMapProvider()
{
return [
Expand All @@ -97,6 +100,10 @@ public function configMapProvider()
['getTransactionInfoSyncKeys', 'transactionSyncKeys', 'a,b,c', ['a', 'b', 'c']],
];
}

/**
* @return array
*/
public function environmentUrlProvider()
{
return [
Expand All @@ -105,6 +112,9 @@ public function environmentUrlProvider()
];
}

/**
* @return array
*/
public function environmentSolutionProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,22 @@ public function testBuildWithBothAddresses()
$this->assertEquals('abc', $result['transactionRequest']['customerIP']);
}

/**
* @param $responseData
* @param $addressPrefix
*/
private function validateAddressData($responseData, $addressPrefix)
{
foreach ($this->mockAddressData as $fieldValue => $field) {
$this->assertEquals($addressPrefix . $field['sampleData'], $responseData[$fieldValue]);
}
}

/**
* @param $prefix
*
* @return \PHPUnit\Framework\MockObject\MockObject
*/
private function createAddressMock($prefix)
{
$addressAdapterMock = $this->createMock(AddressAdapterInterface::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public function testDoesNothingWhenPending(string $status)
$this->handler->handle($subject, $response);
}

/**
* @return array
*/
public function pendingTransactionStatusesProvider()
{
return [
Expand All @@ -120,6 +123,9 @@ public function pendingTransactionStatusesProvider()
];
}

/**
* @return array
*/
public function declinedTransactionStatusesProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
<waitForPageLoad stepKey="waitForGridLoad"/>
</actionGroup>

<!--Filter and select the the product -->
<!--Filter and select the product -->
<actionGroup name="filterAndSelectProduct">
<annotations>
<description>Goes to the Admin Products grid. Filters the Product grid by the provided Product SKU.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ public function testIsExist($fileName, $fileMediaPath)
$this->assertTrue($this->model->isExist($fileName));
}

/**
* @return array
*/
public function isExistProvider()
{
return [
Expand All @@ -213,6 +216,9 @@ public function testIsBeginsWithMediaDirectoryPath($fileName, $expected)
$this->assertEquals($expected, $this->model->isBeginsWithMediaDirectoryPath($fileName));
}

/**
* @return array
*/
public function isBeginsWithMediaDirectoryPathProvider()
{
return [
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Test/Unit/Model/ProductTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ public function testGetStoreSingleSiteModelIds(
$this->assertEquals($websiteIDs, $this->model->getStoreIds());
}

/**
* @return array
*/
public function getSingleStoreIds()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
<!-- Check product in checkout cart items -->
<actionGroup name="CheckProductInCheckoutCartItemsActionGroup">
<annotations>
<description>Validates the the provided Product appears in the Storefront Checkout 'Order Summary' section.</description>
<description>Validates the provided Product appears in the Storefront Checkout 'Order Summary' section.</description>
</annotations>
<arguments>
<argument name="productVar"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ public function testProcess($cartData, $expected)
$this->assertEquals($this->requestProcessor->process($cartData), $expected);
}

/**
* @return array
*/
public function cartDataProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="SetGroupForValidVATIdIntraUnionActionGroup">
<annotations>
<description>Goes to the 'Configuration' page for 'Customer Configuration'. Sets the 'Group For Valid VAT ID Intra Union' option. Clicks on the Save button. Validates the the Save message is present.</description>
<description>Goes to the 'Configuration' page for 'Customer Configuration'. Sets the 'Group For Valid VAT ID Intra Union' option. Clicks on the Save button. Validates the Save message is present.</description>
</annotations>
<arguments>
<argument name="value" type="string"/>
Expand Down
14 changes: 11 additions & 3 deletions app/code/Magento/Deploy/Console/DeployStaticOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ class DeployStaticOptions
*/
const NO_JAVASCRIPT = 'no-javascript';

/**
* Key for js-bundle option
*/
const NO_JS_BUNDLE = 'no-js-bundle';

/**
* Key for css option
*/
Expand Down Expand Up @@ -122,9 +127,6 @@ class DeployStaticOptions
*/
const NO_LESS = 'no-less';

/**
* Default jobs amount
*/
const DEFAULT_JOBS_AMOUNT = 0;

/**
Expand Down Expand Up @@ -275,6 +277,12 @@ private function getSkipOptions()
InputOption::VALUE_NONE,
'Do not deploy JavaScript files.'
),
new InputOption(
self::NO_JS_BUNDLE,
null,
InputOption::VALUE_NONE,
'Do not deploy JavaScript bundle files.'
),
new InputOption(
self::NO_CSS,
null,
Expand Down
39 changes: 25 additions & 14 deletions app/code/Magento/Deploy/Service/DeployStaticContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
namespace Magento\Deploy\Service;

use Magento\Deploy\Strategy\DeployStrategyFactory;
use Magento\Deploy\Process\QueueFactory;
use Magento\Deploy\Console\DeployStaticOptions as Options;
use Magento\Deploy\Process\QueueFactory;
use Magento\Deploy\Strategy\DeployStrategyFactory;
use Magento\Framework\App\View\Deployment\Version\StorageInterface;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\ObjectManagerInterface;
Expand Down Expand Up @@ -75,6 +75,9 @@ public function __construct(
* @param array $options
* @throws LocalizedException
* @return void
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function deploy(array $options)
{
Expand Down Expand Up @@ -106,27 +109,35 @@ public function deploy(array $options)

$deployStrategy = $this->deployStrategyFactory->create(
$options[Options::STRATEGY],
[
'queue' => $this->queueFactory->create($queueOptions)
]
['queue' => $this->queueFactory->create($queueOptions)]
);

$packages = $deployStrategy->deploy($options);

if ($options[Options::NO_JAVASCRIPT] !== true) {
$deployRjsConfig = $this->objectManager->create(DeployRequireJsConfig::class, [
'logger' => $this->logger
]);
$deployI18n = $this->objectManager->create(DeployTranslationsDictionary::class, [
'logger' => $this->logger
]);
$deployBundle = $this->objectManager->create(Bundle::class, [
'logger' => $this->logger
]);
$deployRjsConfig = $this->objectManager->create(
DeployRequireJsConfig::class,
['logger' => $this->logger]
);
$deployI18n = $this->objectManager->create(
DeployTranslationsDictionary::class,
['logger' => $this->logger]
);
foreach ($packages as $package) {
if (!$package->isVirtual()) {
$deployRjsConfig->deploy($package->getArea(), $package->getTheme(), $package->getLocale());
$deployI18n->deploy($package->getArea(), $package->getTheme(), $package->getLocale());
}
}
}

if ($options[Options::NO_JAVASCRIPT] !== true && $options[Options::NO_JS_BUNDLE] !== true) {
$deployBundle = $this->objectManager->create(
Bundle::class,
['logger' => $this->logger]
);
foreach ($packages as $package) {
if (!$package->isVirtual()) {
$deployBundle->deploy($package->getArea(), $package->getTheme(), $package->getLocale());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function testDeploy($options, $expectedContentVersion)
$package->expects($this->never())->method('getTheme');
$package->expects($this->never())->method('getLocale');
} else {
$package->expects($this->exactly(1))->method('isVirtual')->willReturn(false);
$package->expects($this->exactly(2))->method('isVirtual')->willReturn(false);
$package->expects($this->exactly(3))->method('getArea')->willReturn('area');
$package->expects($this->exactly(3))->method('getTheme')->willReturn('theme');
$package->expects($this->exactly(3))->method('getLocale')->willReturn('locale');
Expand Down Expand Up @@ -198,6 +198,7 @@ public function deployDataProvider()
[
'strategy' => 'compact',
'no-javascript' => false,
'no-js-bundle' => false,
'no-html-minify' => false,
'refresh-content-version-only' => false,
],
Expand All @@ -207,6 +208,7 @@ public function deployDataProvider()
[
'strategy' => 'compact',
'no-javascript' => false,
'no-js-bundle' => false,
'no-html-minify' => false,
'refresh-content-version-only' => false,
'content-version' => '123456',
Expand All @@ -226,25 +228,28 @@ public function deployDataProvider()
public function testMaxExecutionTimeOptionPassed()
{
$options = [
DeployStaticOptions::MAX_EXECUTION_TIME => 100,
DeployStaticOptions::MAX_EXECUTION_TIME => 100,
DeployStaticOptions::REFRESH_CONTENT_VERSION_ONLY => false,
DeployStaticOptions::JOBS_AMOUNT => 3,
DeployStaticOptions::STRATEGY => 'compact',
DeployStaticOptions::NO_JAVASCRIPT => true,
DeployStaticOptions::NO_HTML_MINIFY => true,
DeployStaticOptions::JOBS_AMOUNT => 3,
DeployStaticOptions::STRATEGY => 'compact',
DeployStaticOptions::NO_JAVASCRIPT => true,
DeployStaticOptions::NO_JS_BUNDLE => true,
DeployStaticOptions::NO_HTML_MINIFY => true,
];

$queueMock = $this->createMock(Queue::class);
$strategyMock = $this->createMock(CompactDeploy::class);
$this->queueFactory->expects($this->once())
->method('create')
->with([
'logger' => $this->logger,
'maxExecTime' => 100,
'maxProcesses' => 3,
'options' => $options,
'deployPackageService' => null
])
->with(
[
'logger' => $this->logger,
'maxExecTime' => 100,
'maxProcesses' => 3,
'options' => $options,
'deployPackageService' => null
]
)
->willReturn($queueMock);
$this->deployStrategyFactory->expects($this->once())
->method('create')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use Magento\Framework\App\TemplateTypesInterface;
<?= $block->getBlockHtml('formkey') ?>
<fieldset class="admin__fieldset form-inline">
<legend class="admin__legend"><span><?= $block->escapeHtml(__('Load Default Template')) ?></span></legend><br>
<div class="admin__field">
<label class="admin__field-label" for="template_select"><?= $block->escapeHtml(__('Template')) ?></label>
<div class="admin__field required">
<label class="admin__field-label" for="template_select"><span><?= $block->escapeHtml(__('Template')) ?></span></label>
<div class="admin__field-control">
<select id="template_select" name="code" class="admin__control-select required-entry">
<?php foreach ($block->getTemplateOptions() as $group => $options) : ?>
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/ImportExport/Test/Unit/Model/ImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,9 @@ public function testGetUnknownEntity($entity)
$import->getEntity();
}

/**
* @return array
*/
public function unknownEntitiesProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testCanShowBlock()
->method('isEnabled')
->with($this->catalogLayerMock, $filters)
->will($this->returnValue($enabled));

$category = $this->createMock(Category::class);
$this->catalogLayerMock->expects($this->atLeastOnce())->method('getCurrentCategory')->willReturn($category);
$category->expects($this->once())->method('getDisplayMode')->willReturn(Category::DM_PRODUCT);
Expand All @@ -119,12 +119,12 @@ public function testCanShowBlock()
public function testCanShowBlockWithDifferentDisplayModes(string $mode, bool $result)
{
$filters = ['To' => 'be', 'or' => 'not', 'to' => 'be'];

$this->filterListMock->expects($this->atLeastOnce())->method('getFilters')
->with($this->catalogLayerMock)
->will($this->returnValue($filters));
$this->assertEquals($filters, $this->model->getFilters());

$this->visibilityFlagMock
->expects($this->any())
->method('isEnabled')
Expand All @@ -137,6 +137,9 @@ public function testCanShowBlockWithDifferentDisplayModes(string $mode, bool $re
$this->assertEquals($result, $this->model->canShowBlock());
}

/**
* @return array
*/
public function canShowBlockDataProvider()
{
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<argument name="id" xsi:type="string">accounts</argument>
<argument name="column_css_class" xsi:type="string">col-qty</argument>
<argument name="header_css_class" xsi:type="string">col-qty</argument>
<argument name="sortable" xsi:type="string">0</argument>
</arguments>
</block>
</referenceBlock>
Expand Down
8 changes: 8 additions & 0 deletions app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,12 @@ public function getFormValues()
{
return $this->_getAddress()->getData();
}

/**
* @inheritDoc
*/
protected function getAddressStoreId()
{
return $this->_getAddress()->getOrder()->getStoreId();
}
}
Loading

0 comments on commit abbfa03

Please sign in to comment.