Skip to content

Commit fac79df

Browse files
committed
Merge remote-tracking branch 'mainline/2.2-develop' into MAGETWO-97585-2.2
2 parents b43d292 + 540d2f3 commit fac79df

File tree

29 files changed

+396
-449
lines changed

29 files changed

+396
-449
lines changed

app/code/Magento/Contact/view/frontend/web/css/source/_module.less

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
}
2222
}
2323

24+
//
25+
// Desktop
26+
// _____________________________________________
27+
28+
.media-width(@extremum, @break) when (@extremum = 'min') and (@break = @screen__m) {
29+
.contact-index-index .column:not(.sidebar-additional) .form.contact {
30+
min-width: 600px;
31+
}
32+
}
33+
2434
// Mobile
2535
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
2636
.contact-index-index {

app/code/Magento/Directory/Model/CurrencyConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(
5757
*/
5858
public function getConfigCurrencies(string $path)
5959
{
60-
$result = $this->appState->getAreaCode() === Area::AREA_ADMINHTML
60+
$result = in_array($this->appState->getAreaCode(), [Area::AREA_ADMINHTML, Area::AREA_CRONTAB])
6161
? $this->getConfigForAllStores($path)
6262
: $this->getConfigForCurrentStore($path);
6363
sort($result);

app/code/Magento/Directory/Test/Unit/Model/CurrencyConfigTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function setUp()
6868
}
6969

7070
/**
71-
* Test get currency config for admin and storefront areas.
71+
* Test get currency config for admin, crontab and storefront areas.
7272
*
7373
* @dataProvider getConfigCurrenciesDataProvider
7474
* @return void
@@ -91,7 +91,7 @@ public function testGetConfigCurrencies(string $areCode)
9191
->method('getCode')
9292
->willReturn('testCode');
9393

94-
if ($areCode === Area::AREA_ADMINHTML) {
94+
if (in_array($areCode, [Area::AREA_ADMINHTML, Area::AREA_CRONTAB])) {
9595
$this->storeManager->expects(self::once())
9696
->method('getStores')
9797
->willReturn([$store]);
@@ -121,6 +121,7 @@ public function getConfigCurrenciesDataProvider()
121121
{
122122
return [
123123
['areaCode' => Area::AREA_ADMINHTML],
124+
['areaCode' => Area::AREA_CRONTAB],
124125
['areaCode' => Area::AREA_FRONTEND],
125126
];
126127
}

app/code/Magento/SalesRule/Model/Utility.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ public function deltaRoundingFix(
189189
) {
190190
$discountAmount = $discountData->getAmount();
191191
$baseDiscountAmount = $discountData->getBaseAmount();
192+
$rowTotalInclTax = $item->getRowTotalInclTax();
193+
$baseRowTotalInclTax = $item->getBaseRowTotalInclTax();
192194

193195
//TODO Seems \Magento\Quote\Model\Quote\Item\AbstractItem::getDiscountPercent() returns float value
194196
//that can not be used as array index
@@ -205,6 +207,23 @@ public function deltaRoundingFix(
205207
- $this->priceCurrency->round($baseDiscountAmount);
206208
}
207209

210+
/**
211+
* When we have 100% discount check if totals will not be negative
212+
*/
213+
214+
if ($percentKey == 100) {
215+
$discountDelta = $rowTotalInclTax - $discountAmount;
216+
$baseDiscountDelta = $baseRowTotalInclTax - $baseDiscountAmount;
217+
218+
if ($discountDelta < 0) {
219+
$discountAmount += $discountDelta;
220+
}
221+
222+
if ($baseDiscountDelta < 0) {
223+
$baseDiscountAmount += $baseDiscountDelta;
224+
}
225+
}
226+
208227
$discountData->setAmount($this->priceCurrency->round($discountAmount));
209228
$discountData->setBaseAmount($this->priceCurrency->round($baseDiscountAmount));
210229

app/code/Magento/Tax/Model/Calculation/AbstractAggregateCalculator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ protected function calculateWithTaxNotInPrice(QuoteDetailsItemInterface $item, $
156156
$rowTaxBeforeDiscount = array_sum($rowTaxesBeforeDiscount);
157157
$rowTotalInclTax = $rowTotal + $rowTaxBeforeDiscount;
158158
$priceInclTax = $rowTotalInclTax / $quantity;
159+
159160
if ($round) {
160161
$priceInclTax = $this->calculationTool->round($priceInclTax);
161162
}

app/design/frontend/Magento/luma/web/css/source/components/_modals_extend.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
.modal-custom {
6161
.action-close {
62-
.lib-css(margin, @indent__m);
62+
.lib-css(margin, 15px);
6363
}
6464
}
6565

dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
use Magento\Mtf\Util\Protocol\CurlInterface;
1010
use Magento\Mtf\Util\Protocol\CurlTransport;
11-
use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator;
1211

1312
/**
1413
* Perform bin/magento commands from command line for functional tests executions.
@@ -18,7 +17,7 @@ class Cli
1817
/**
1918
* Url to command.php.
2019
*/
21-
const URL = '/dev/tests/functional/utils/command.php';
20+
const URL = 'dev/tests/functional/utils/command.php';
2221

2322
/**
2423
* Curl transport protocol.
@@ -27,21 +26,12 @@ class Cli
2726
*/
2827
private $transport;
2928

30-
/**
31-
* Webapi handler.
32-
*
33-
* @var WebapiDecorator
34-
*/
35-
private $webapiHandler;
36-
3729
/**
3830
* @param CurlTransport $transport
39-
* @param WebapiDecorator $webapiHandler
4031
*/
41-
public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler)
32+
public function __construct(CurlTransport $transport)
4233
{
4334
$this->transport = $transport;
44-
$this->webapiHandler = $webapiHandler;
4535
}
4636

4737
/**
@@ -53,31 +43,22 @@ public function __construct(CurlTransport $transport, WebapiDecorator $webapiHan
5343
*/
5444
public function execute($command, $options = [])
5545
{
56-
$this->transport->write(
57-
rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL,
58-
$this->prepareParamArray($command, $options),
59-
CurlInterface::POST,
60-
[]
61-
);
62-
$this->transport->read();
63-
$this->transport->close();
46+
$curl = $this->transport;
47+
$curl->write($this->prepareUrl($command, $options), [], CurlInterface::GET);
48+
$curl->read();
49+
$curl->close();
6450
}
6551

6652
/**
67-
* Prepare parameter array.
53+
* Prepare url.
6854
*
6955
* @param string $command
7056
* @param array $options [optional]
71-
* @return array
57+
* @return string
7258
*/
73-
private function prepareParamArray($command, $options = [])
59+
private function prepareUrl($command, $options = [])
7460
{
75-
if (!empty($options)) {
76-
$command .= ' ' . implode(' ', $options);
77-
}
78-
return [
79-
'token' => urlencode($this->webapiHandler->getWebapiToken()),
80-
'command' => urlencode($command)
81-
];
61+
$command .= ' ' . implode(' ', $options);
62+
return $_ENV['app_frontend_url'] . self::URL . '?command=' . urlencode($command);
8263
}
8364
}

dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/Reader.php

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Mtf\Util\Command\File\Export;
78

89
use Magento\Mtf\ObjectManagerInterface;
910
use Magento\Mtf\Util\Protocol\CurlTransport;
1011
use Magento\Mtf\Util\Protocol\CurlInterface;
11-
use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator;
1212

1313
/**
1414
* File reader for Magento export files.
@@ -36,29 +36,16 @@ class Reader implements ReaderInterface
3636
*/
3737
private $transport;
3838

39-
/**
40-
* Webapi handler.
41-
*
42-
* @var WebapiDecorator
43-
*/
44-
private $webapiHandler;
45-
4639
/**
4740
* @param ObjectManagerInterface $objectManager
4841
* @param CurlTransport $transport
49-
* @param WebapiDecorator $webapiHandler
5042
* @param string $template
5143
*/
52-
public function __construct(
53-
ObjectManagerInterface $objectManager,
54-
CurlTransport $transport,
55-
WebapiDecorator $webapiHandler,
56-
$template
57-
) {
44+
public function __construct(ObjectManagerInterface $objectManager, CurlTransport $transport, $template)
45+
{
5846
$this->objectManager = $objectManager;
5947
$this->template = $template;
6048
$this->transport = $transport;
61-
$this->webapiHandler = $webapiHandler;
6249
}
6350

6451
/**
@@ -83,27 +70,20 @@ public function getData()
8370
*/
8471
private function getFiles()
8572
{
86-
$this->transport->write(
87-
rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL,
88-
$this->prepareParamArray(),
89-
CurlInterface::POST,
90-
[]
91-
);
73+
$this->transport->write($this->prepareUrl(), [], CurlInterface::GET);
9274
$serializedFiles = $this->transport->read();
9375
$this->transport->close();
76+
9477
return unserialize($serializedFiles);
9578
}
9679

9780
/**
98-
* Prepare parameter array.
81+
* Prepare url.
9982
*
100-
* @return array
83+
* @return string
10184
*/
102-
private function prepareParamArray()
85+
private function prepareUrl()
10386
{
104-
return [
105-
'token' => urlencode($this->webapiHandler->getWebapiToken()),
106-
'template' => urlencode($this->template)
107-
];
87+
return $_ENV['app_frontend_url'] . self::URL . '?template=' . urlencode($this->template);
10888
}
10989
}

dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Export/ReaderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface ReaderInterface
1414
/**
1515
* Url to export.php.
1616
*/
17-
const URL = '/dev/tests/functional/utils/export.php';
17+
const URL = 'dev/tests/functional/utils/export.php';
1818

1919
/**
2020
* Exporting files as Data object from Magento.

dev/tests/functional/lib/Magento/Mtf/Util/Command/File/Log.php

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Mtf\Util\Command\File;
88

99
use Magento\Mtf\Util\Protocol\CurlTransport;
10-
use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator;
1110

1211
/**
1312
* Get content of log file in var/log folder.
@@ -17,7 +16,7 @@ class Log
1716
/**
1817
* Url to log.php.
1918
*/
20-
const URL = '/dev/tests/functional/utils/log.php';
19+
const URL = 'dev/tests/functional/utils/log.php';
2120

2221
/**
2322
* Curl transport protocol.
@@ -26,21 +25,12 @@ class Log
2625
*/
2726
private $transport;
2827

29-
/**
30-
* Webapi handler.
31-
*
32-
* @var WebapiDecorator
33-
*/
34-
private $webapiHandler;
35-
3628
/**
3729
* @param CurlTransport $transport
38-
* @param WebapiDecorator $webapiHandler
3930
*/
40-
public function __construct(CurlTransport $transport, WebapiDecorator $webapiHandler)
31+
public function __construct(CurlTransport $transport)
4132
{
4233
$this->transport = $transport;
43-
$this->webapiHandler = $webapiHandler;
4434
}
4535

4636
/**
@@ -51,28 +41,22 @@ public function __construct(CurlTransport $transport, WebapiDecorator $webapiHan
5141
*/
5242
public function getFileContent($name)
5343
{
54-
$this->transport->write(
55-
rtrim(str_replace('index.php', '', $_ENV['app_frontend_url']), '/') . self::URL,
56-
$this->prepareParamArray($name),
57-
CurlInterface::POST,
58-
[]
59-
);
60-
$data = $this->transport->read();
61-
$this->transport->close();
44+
$curl = $this->transport;
45+
$curl->write($this->prepareUrl($name), [], CurlTransport::GET);
46+
$data = $curl->read();
47+
$curl->close();
48+
6249
return unserialize($data);
6350
}
6451

6552
/**
66-
* Prepare parameter array.
53+
* Prepare url.
6754
*
6855
* @param string $name
69-
* @return array
56+
* @return string
7057
*/
71-
private function prepareParamArray($name)
58+
private function prepareUrl($name)
7259
{
73-
return [
74-
'token' => urlencode($this->webapiHandler->getWebapiToken()),
75-
'name' => urlencode($name)
76-
];
60+
return $_ENV['app_frontend_url'] . self::URL . '?name=' . urlencode($name);
7761
}
7862
}

0 commit comments

Comments
 (0)