Skip to content

Commit 1c7e3d2

Browse files
Merge branch 'develop' of https://github.com/magento/magento2ce into MAGETWO-53570
2 parents f3ecc0e + 3ef1e28 commit 1c7e3d2

File tree

706 files changed

+21412
-5820
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

706 files changed

+21412
-5820
lines changed

app/code/Magento/Backend/App/Action/Plugin/MassactionKey.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@
77
*/
88
namespace Magento\Backend\App\Action\Plugin;
99

10+
use Magento\Framework\App\RequestInterface;
11+
use Magento\Backend\App\AbstractAction;
12+
1013
class MassactionKey
1114
{
1215
/**
1316
* Process massaction key
1417
*
15-
* @param \Magento\Backend\App\AbstractAction $subject
16-
* @param callable $proceed
17-
* @param \Magento\Framework\App\RequestInterface $request
18+
* @param AbstractAction $subject
19+
* @param RequestInterface $request
1820
*
19-
* @return mixed
21+
* @return void
2022
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2123
*/
22-
public function aroundDispatch(
23-
\Magento\Backend\App\AbstractAction $subject,
24-
\Closure $proceed,
25-
\Magento\Framework\App\RequestInterface $request
26-
) {
24+
public function beforeDispatch(AbstractAction $subject, RequestInterface $request)
25+
{
2726
$key = $request->getPost('massaction_prepare_key');
2827
if ($key) {
2928
$postData = $request->getPost($key);
3029
$value = is_array($postData) ? $postData : explode(',', $postData);
3130
$request->setPostValue($key, $value ? $value : null);
3231
}
33-
return $proceed($request);
3432
}
3533
}

app/code/Magento/Backend/Model/View/Result/Redirect.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\Backend\Model\UrlInterface;
1111
use Magento\Framework\App;
1212
use Magento\Framework\App\ActionFlag;
13+
use Magento\Framework\App\Response\HttpInterface as HttpResponseInterface;
1314

1415
class Redirect extends \Magento\Framework\Controller\Result\Redirect
1516
{
@@ -56,7 +57,7 @@ public function setRefererOrBaseUrl()
5657
/**
5758
* {@inheritdoc}
5859
*/
59-
protected function render(App\ResponseInterface $response)
60+
protected function render(HttpResponseInterface $response)
6061
{
6162
$this->session->setIsUrlNotice($this->actionFlag->get('', AbstractAction::FLAG_IS_URLS_CHECKED));
6263
return parent::render($response);

app/code/Magento/Backend/Test/Unit/App/Action/Plugin/MassactionKeyTest.php

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\Backend\Test\Unit\App\Action\Plugin;
77

88
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
9+
use Magento\Backend\App\AbstractAction;
10+
use Magento\Framework\App\RequestInterface;
911

1012
class MassactionKeyTest extends \PHPUnit_Framework_TestCase
1113
{
@@ -15,17 +17,12 @@ class MassactionKeyTest extends \PHPUnit_Framework_TestCase
1517
protected $plugin;
1618

1719
/**
18-
* @var \Closure
19-
*/
20-
protected $closureMock;
21-
22-
/**
23-
* @var \PHPUnit_Framework_MockObject_MockObject
20+
* @var \PHPUnit_Framework_MockObject_MockObject|RequestInterface
2421
*/
2522
protected $requestMock;
2623

2724
/**
28-
* @var \PHPUnit_Framework_MockObject_MockObject
25+
* @var \PHPUnit_Framework_MockObject_MockObject|AbstractAction
2926
*/
3027
protected $subjectMock;
3128

@@ -35,27 +32,32 @@ protected function setUp()
3532
return 'Expected';
3633
};
3734
$this->subjectMock = $this->getMock(\Magento\Backend\App\AbstractAction::class, [], [], '', false);
38-
$this->requestMock = $this->getMock(\Magento\Framework\App\Request\Http::class, [], [], '', false);
35+
$this->requestMock = $this->getMockForAbstractClass(
36+
RequestInterface::class,
37+
[],
38+
'',
39+
false,
40+
false,
41+
true,
42+
['getPost', 'setPostValue']
43+
);
3944

4045
$objectManager = new ObjectManager($this);
4146
$this->plugin = $objectManager->getObject(
4247
\Magento\Backend\App\Action\Plugin\MassactionKey::class,
4348
[
4449
'subject' => $this->subjectMock,
45-
'closure' => $this->closureMock,
4650
'request' => $this->requestMock,
4751
]
4852
);
4953
}
5054

5155
/**
52-
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundDispatch
53-
*
5456
* @param $postData array|string
5557
* @param array $convertedData
56-
* @dataProvider aroundDispatchDataProvider
58+
* @dataProvider beforeDispatchDataProvider
5759
*/
58-
public function testAroundDispatchWhenMassactionPrepareKeyRequestExists($postData, $convertedData)
60+
public function testBeforeDispatchWhenMassactionPrepareKeyRequestExists($postData, $convertedData)
5961
{
6062
$this->requestMock->expects($this->at(0))
6163
->method('getPost')
@@ -69,24 +71,18 @@ public function testAroundDispatchWhenMassactionPrepareKeyRequestExists($postDat
6971
->method('setPostValue')
7072
->with('key', $convertedData);
7173

72-
$this->assertEquals(
73-
'Expected',
74-
$this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock)
75-
);
74+
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
7675
}
7776

78-
public function aroundDispatchDataProvider()
77+
public function beforeDispatchDataProvider()
7978
{
8079
return [
8180
'post_data_is_array' => [['key'], ['key']],
8281
'post_data_is_string' => ['key, key_two', ['key', ' key_two']]
8382
];
8483
}
8584

86-
/**
87-
* @covers \Magento\Backend\App\Action\Plugin\MassactionKey::aroundDispatch
88-
*/
89-
public function testAroundDispatchWhenMassactionPrepareKeyRequestNotExists()
85+
public function testBeforeDispatchWhenMassactionPrepareKeyRequestNotExists()
9086
{
9187
$this->requestMock->expects($this->once())
9288
->method('getPost')
@@ -95,9 +91,6 @@ public function testAroundDispatchWhenMassactionPrepareKeyRequestNotExists()
9591
$this->requestMock->expects($this->never())
9692
->method('setPostValue');
9793

98-
$this->assertEquals(
99-
'Expected',
100-
$this->plugin->aroundDispatch($this->subjectMock, $this->closureMock, $this->requestMock)
101-
);
94+
$this->plugin->beforeDispatch($this->subjectMock, $this->requestMock);
10295
}
10396
}

app/code/Magento/Backend/view/adminhtml/ui_component/design_config_form.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
<item name="fit" xsi:type="boolean">false</item>
7070
<item name="label" xsi:type="string">Search String</item>
7171
<item name="showFallbackReset" xsi:type="boolean">false</item>
72+
<item name="validation" xsi:type="array">
73+
<item name="required-entry" xsi:type="boolean">true</item>
74+
</item>
7275
</item>
7376
</argument>
7477
</field>
@@ -82,6 +85,9 @@
8285
<item name="fit" xsi:type="boolean">false</item>
8386
<item name="label" xsi:type="string">Theme Name</item>
8487
<item name="showFallbackReset" xsi:type="boolean">false</item>
88+
<item name="validation" xsi:type="array">
89+
<item name="required-entry" xsi:type="boolean">true</item>
90+
</item>
8591
</item>
8692
</argument>
8793
</field>

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/cells/action-delete.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
title: $parent.deleteButtonLabel
1212
}
1313
">
14-
<span data-bind="text: $parent.deleteButtonLabel"></span>
14+
<span translate="$parent.deleteButtonLabel"></span>
1515
</button>

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class="action-secondary"
1717
type="button"
1818
click="processingAddChild.bind($data, false, false, false)">
19-
<span text="addButtonLabel"/>
19+
<span translate="addButtonLabel"/>
2020
</button>
2121
</div>
2222

@@ -30,7 +30,7 @@
3030
css="element.setClasses(element)"
3131
attr="'data-index': index">
3232
<label if="element.label" class="admin__field-label" attr="for: element.uid">
33-
<span text="element.label"/>
33+
<span translate="element.label"/>
3434
</label>
3535

3636
<div class="admin__field-control" data-role="grid-wrapper">
@@ -51,7 +51,7 @@
5151

5252
<th repeat="foreach: labels, item: '$label'"
5353
class="data-grid-th"
54-
text="$label().label"
54+
translate="$label().label"
5555
visible="$label().visible"
5656
disable="$label().disabled"
5757
css="setClasses($label())">

app/code/Magento/Braintree/Gateway/Command/CaptureStrategyCommand.php

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,25 @@ private function isExpiredAuthorization(OrderPaymentInterface $payment)
166166
*/
167167
private function isExistsCaptureTransaction(OrderPaymentInterface $payment)
168168
{
169-
$filters[] = $this->filterBuilder->setField('payment_id')
170-
->setValue($payment->getId())
171-
->create();
169+
$this->searchCriteriaBuilder->addFilters(
170+
[
171+
$this->filterBuilder
172+
->setField('payment_id')
173+
->setValue($payment->getId())
174+
->create(),
175+
]
176+
);
172177

173-
$filters[] = $this->filterBuilder->setField('txn_type')
174-
->setValue(TransactionInterface::TYPE_CAPTURE)
175-
->create();
178+
$this->searchCriteriaBuilder->addFilters(
179+
[
180+
$this->filterBuilder
181+
->setField('txn_type')
182+
->setValue(TransactionInterface::TYPE_CAPTURE)
183+
->create(),
184+
]
185+
);
176186

177-
$searchCriteria = $this->searchCriteriaBuilder->addFilters($filters)
178-
->create();
187+
$searchCriteria = $this->searchCriteriaBuilder->create();
179188

180189
$count = $this->transactionRepository->getList($searchCriteria)->getTotalCount();
181190
return (boolean) $count;

app/code/Magento/Braintree/Gateway/Response/RiskDataHandler.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class RiskDataHandler implements HandlerInterface
2424
*/
2525
const RISK_DATA_DECISION = 'riskDataDecision';
2626

27+
/**
28+
* Risk data Review status
29+
*/
30+
private static $statusReview = 'Review';
31+
2732
/**
2833
* @var SubjectReader
2934
*/
@@ -62,5 +67,10 @@ public function handle(array $handlingSubject, array $response)
6267

6368
$payment->setAdditionalInformation(self::RISK_DATA_ID, $transaction->riskData->id);
6469
$payment->setAdditionalInformation(self::RISK_DATA_DECISION, $transaction->riskData->decision);
70+
71+
// mark payment as fraud
72+
if ($transaction->riskData->decision === self::$statusReview) {
73+
$payment->setIsFraudDetected(true);
74+
}
6575
}
6676
}

app/code/Magento/Braintree/Test/Unit/Gateway/Command/CaptureStrategyCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private function buildSearchCriteria()
374374
->willReturnSelf();
375375

376376
$searchCriteria = new SearchCriteria();
377-
$this->searchCriteriaBuilder->expects(static::once())
377+
$this->searchCriteriaBuilder->expects(static::exactly(2))
378378
->method('addFilters')
379379
->willReturnSelf();
380380
$this->searchCriteriaBuilder->expects(static::once())

app/code/Magento/Braintree/Test/Unit/Gateway/Request/VaultCaptureDataBuilderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testBuild()
8080
$paymentExtension = $this->getMockBuilder(OrderPaymentExtension::class)
8181
->setMethods(['getVaultPaymentToken'])
8282
->disableOriginalConstructor()
83-
->getMock();
83+
->getMockForAbstractClass();
8484

8585
$paymentToken = $this->getMockBuilder(PaymentToken::class)
8686
->disableOriginalConstructor()

0 commit comments

Comments
 (0)