Skip to content

Commit bc664fa

Browse files
committed
MAGETWO-69373: Merge branch 'develop' of github.com:magento/magento2ce into MAGETWO-69373-PR-9712
2 parents 296b43b + 83e7b3b commit bc664fa

File tree

213 files changed

+6101
-1098
lines changed

Some content is hidden

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

213 files changed

+6101
-1098
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ addons:
77
- mysql-client-core-5.6
88
- mysql-client-5.6
99
- postfix
10+
firefox: "46.0"
11+
hosts:
12+
- magento2.travis
1013
language: php
1114
php:
1215
- 7.0
@@ -16,19 +19,26 @@ env:
1619
- COMPOSER_BIN_DIR=~/bin
1720
- INTEGRATION_SETS=3
1821
- NODE_JS_VERSION=6
22+
- MAGENTO_HOST_NAME="magento2.travis"
1923
matrix:
2024
- TEST_SUITE=unit
2125
- TEST_SUITE=integration INTEGRATION_INDEX=1
2226
- TEST_SUITE=integration INTEGRATION_INDEX=2
2327
- TEST_SUITE=integration INTEGRATION_INDEX=3
2428
- TEST_SUITE=static
2529
- TEST_SUITE=js
30+
- TEST_SUITE=functional ACCEPTANCE_INDEX=1
31+
- TEST_SUITE=functional ACCEPTANCE_INDEX=2
2632
matrix:
2733
exclude:
2834
- php: 7.0
2935
env: TEST_SUITE=static
3036
- php: 7.0
3137
env: TEST_SUITE=js
38+
- php: 7.0
39+
env: TEST_SUITE=functional ACCEPTANCE_INDEX=1
40+
- php: 7.0
41+
env: TEST_SUITE=functional ACCEPTANCE_INDEX=2
3242
cache:
3343
apt: true
3444
directories:

app/code/Magento/AdminNotification/Block/Grid/Renderer/Actions.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
* See COPYING.txt for license details.
77
*/
88

9-
// @codingStandardsIgnoreFile
10-
119
namespace Magento\AdminNotification\Block\Grid\Renderer;
1210

1311
class Actions extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
@@ -39,9 +37,8 @@ public function __construct(
3937
*/
4038
public function render(\Magento\Framework\DataObject $row)
4139
{
42-
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' . __(
43-
'Read Details'
44-
) . '</a>' : '';
40+
$readDetailsHtml = $row->getUrl() ? '<a class="action-details" target="_blank" href="' . $row->getUrl() . '">' .
41+
__('Read Details') . '</a>' : '';
4542

4643
$markAsReadHtml = !$row->getIsRead() ? '<a class="action-mark" href="' . $this->getUrl(
4744
'*/*/markAsRead/',

app/code/Magento/AdminNotification/Block/ToolbarEntry.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
namespace Magento\AdminNotification\Block;
108

119
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Grid/Collection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* AdminNotification Inbox model
119
*
@@ -18,7 +16,7 @@ class Collection extends \Magento\AdminNotification\Model\ResourceModel\Inbox\Co
1816
/**
1917
* Add remove filter
2018
*
21-
* @return \Magento\AdminNotification\Model\ResourceModel\Grid\Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
19+
* @return Collection|\Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
2220
*/
2321
protected function _initSelect()
2422
{

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
// @codingStandardsIgnoreFile
8-
97
/**
108
* Test class for \Magento\AdminNotification\Block\ToolbarEntry
119
*/
@@ -53,7 +51,8 @@ public function testGetLatestUnreadNotifications()
5351

5452
// 1. Create mocks
5553
$notificationList = $this->getMockBuilder(
56-
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class)
54+
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class
55+
)
5756
->disableOriginalConstructor()
5857
->getMock();
5958

app/code/Magento/Braintree/Gateway/Config/Config.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,12 @@ public function __construct(
7272
*/
7373
public function getCountrySpecificCardTypeConfig()
7474
{
75-
$countriesCardTypes = $this->serializer->unserialize($this->getValue(self::KEY_COUNTRY_CREDIT_CARD));
76-
77-
return is_array($countriesCardTypes) ? $countriesCardTypes : [];
75+
$countryCardTypes = $this->getValue(self::KEY_COUNTRY_CREDIT_CARD);
76+
if (!$countryCardTypes) {
77+
return [];
78+
}
79+
$countryCardTypes = $this->serializer->unserialize($countryCardTypes);
80+
return is_array($countryCardTypes) ? $countryCardTypes : [];
7881
}
7982

8083
/**

app/code/Magento/Braintree/Model/Adminhtml/System/Config/CountryCreditCard.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,11 @@ public function beforeSave()
8989
*/
9090
public function afterLoad()
9191
{
92-
$value = $this->serializer->unserialize($this->getValue());
93-
if (is_array($value)) {
94-
$value = $this->encodeArrayFieldValue($value);
95-
$this->setValue($value);
92+
if ($this->getValue()) {
93+
$value = $this->serializer->unserialize($this->getValue());
94+
if (is_array($value)) {
95+
$this->setValue($this->encodeArrayFieldValue($value));
96+
}
9697
}
9798
return $this;
9899
}

app/code/Magento/Braintree/Test/Unit/Model/Adminhtml/System/Config/CountryCreditCardTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,24 +150,30 @@ public function beforeSaveDataProvider()
150150
}
151151

152152
/**
153-
* @dataProvider afterLoadDataProvider
154153
* @param string $encodedValue
155154
* @param array|null $value
156155
* @param array $hashData
157156
* @param array|null $expected
157+
* @param int $unserializeCalledNum
158+
* @dataProvider afterLoadDataProvider
158159
*/
159-
public function testAfterLoad($encodedValue, $value, array $hashData, $expected)
160-
{
160+
public function testAfterLoad(
161+
$encodedValue,
162+
$value,
163+
array $hashData,
164+
$expected,
165+
$unserializeCalledNum = 1
166+
) {
161167
$this->model->setValue($encodedValue);
162168
$index = 0;
163169
foreach ($hashData as $hash) {
164-
$this->mathRandomMock->expects(static::at($index))
170+
$this->mathRandomMock->expects($this->at($index))
165171
->method('getUniqueHash')
166172
->willReturn($hash);
167173
$index++;
168174
}
169175

170-
$this->serializerMock->expects($this->once())
176+
$this->serializerMock->expects($this->exactly($unserializeCalledNum))
171177
->method('unserialize')
172178
->with($encodedValue)
173179
->willReturn($value);
@@ -178,6 +184,7 @@ public function testAfterLoad($encodedValue, $value, array $hashData, $expected)
178184

179185
/**
180186
* Get data to test saved credit cards types
187+
*
181188
* @return array
182189
*/
183190
public function afterLoadDataProvider()
@@ -193,7 +200,8 @@ public function afterLoadDataProvider()
193200
'encoded' => '',
194201
'value' => null,
195202
'randomHash' => [],
196-
'expected' => null
203+
'expected' => null,
204+
0
197205
],
198206
'valid data' => [
199207
'encoded' => '{"US":["AE","VI","MA"],"AF":["AE","MA"]}',

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/cc-form.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ define(
3636
braintreeDeviceData: null,
3737
paymentMethodNonce: null,
3838
lastBillingAddress: null,
39+
ccCode: null,
40+
ccMessageContainer: null,
3941
validatorManager: validatorManager,
4042
code: 'braintree',
4143

@@ -138,9 +140,39 @@ define(
138140
return;
139141
}
140142

143+
this.restoreMessageContainer();
144+
this.restoreCode();
145+
146+
/**
147+
* Define onReady callback
148+
*/
149+
braintree.onReady = function () {};
141150
this.initBraintree();
142151
},
143152

153+
/**
154+
* Restore original message container for cc-form component
155+
*/
156+
restoreMessageContainer: function () {
157+
this.messageContainer = this.ccMessageContainer;
158+
},
159+
160+
/**
161+
* Restore original code for cc-form component
162+
*/
163+
restoreCode: function () {
164+
this.code = this.ccCode;
165+
},
166+
167+
/** @inheritdoc */
168+
initChildren: function () {
169+
this._super();
170+
this.ccMessageContainer = this.messageContainer;
171+
this.ccCode = this.code;
172+
173+
return this;
174+
},
175+
144176
/**
145177
* Init config
146178
*/

app/code/Magento/Braintree/view/frontend/web/js/view/payment/method-renderer/vault.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define([
5252
var self = this;
5353

5454
/**
55-
* Define already callback
55+
* Define onReady callback
5656
*/
5757
Braintree.onReady = function () {
5858
self.getPaymentMethodNonce();
@@ -78,6 +78,7 @@ define([
7878
formComponent.setPaymentMethodNonce(response.paymentMethodNonce);
7979
formComponent.additionalData['public_hash'] = self.publicHash;
8080
formComponent.code = self.code;
81+
formComponent.messageContainer = self.messageContainer;
8182
formComponent.placeOrder();
8283
});
8384
})

app/code/Magento/Braintree/view/frontend/web/template/payment/form.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@
139139
<button class="action primary checkout"
140140
type="submit"
141141
data-bind="
142-
click: placeOrderClick,
143-
attr: {title: $t('Place Order')}
144-
">
142+
click: placeOrderClick,
143+
attr: {title: $t('Place Order')},
144+
css: {disabled: !isPlaceOrderActionAllowed()},
145+
enable: isActive()
146+
"
147+
disabled>
145148
<span data-bind="i18n: 'Place Order'"></span>
146149
</button>
147150
</div>

app/code/Magento/Bundle/Model/Product/Price.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected function getBundleSelectionIds(\Magento\Catalog\Model\Product $product
166166
$customOption = $product->getCustomOption('bundle_selection_ids');
167167
if ($customOption) {
168168
$selectionIds = $this->serializer->unserialize($customOption->getValue());
169-
if (!empty($selectionIds) && is_array($selectionIds)) {
169+
if (is_array($selectionIds) && !empty($selectionIds)) {
170170
return $selectionIds;
171171
}
172172
}

app/code/Magento/Bundle/Model/Product/SaveHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function execute($entity, $arguments = [])
6666
$options = $bundleProductOptions ?: [];
6767
foreach ($options as $option) {
6868
$this->optionRepository->save($entity, $option);
69-
$entity->setCopyFromView(false);
7069
}
70+
$entity->setCopyFromView(false);
7171
}
7272
return $entity;
7373
}

app/code/Magento/Bundle/Model/ResourceModel/Selection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function getParentIdsByChild($childId)
126126
'e.' . $metadata->getLinkField() . ' = ' . $this->getMainTable() . '.parent_product_id',
127127
['e.entity_id as parent_product_id']
128128
)->where(
129-
'e.entity_id IN(?)',
129+
$this->getMainTable() . '.product_id IN(?)',
130130
$childId
131131
);
132132

0 commit comments

Comments
 (0)