Skip to content

Commit 9c7bd2c

Browse files
author
Bohdan Korablov
committed
Merge remote-tracking branch 'mainline_ce/develop' into MAGETWO-37720
2 parents 1e57103 + acb837d commit 9c7bd2c

File tree

259 files changed

+11267
-2949
lines changed

Some content is hidden

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

259 files changed

+11267
-2949
lines changed

.travis.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ php:
44
- 5.6
55
env:
66
- TEST_SUITE=unit
7-
- TEST_SUITE=integration
7+
- TEST_SUITE=integration_part_1
8+
- TEST_SUITE=integration_part_2
89
- TEST_SUITE=integration_integrity
910
- TEST_SUITE=static_phpcs
1011
- TEST_SUITE=static_annotation
@@ -32,7 +33,7 @@ before_script:
3233
- echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
3334
# Install MySQL 5.6, create DB for integration tests
3435
- >
35-
sh -c "if [ '$TEST_SUITE' = 'integration' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then
36+
sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ] || [ '$TEST_SUITE' = 'integration_integrity' ]; then
3637
sudo apt-get remove --purge mysql-common mysql-server-5.5 mysql-server-core-5.5 mysql-client-5.5 mysql-client-core-5.5;
3738
sudo apt-get autoremove;
3839
sudo apt-get autoclean;
@@ -50,10 +51,12 @@ script:
5051
# Unit tests
5152
- sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi"
5253
# Integration tests
53-
- sh -c "if [ '$TEST_SUITE' = 'integration' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist; fi"
54+
- sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ] || [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; bash IntegationTestsForTravis.sh 2; fi"
55+
- sh -c "if [ '$TEST_SUITE' = 'integration_part_1' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis1; fi"
56+
- sh -c "if [ '$TEST_SUITE' = 'integration_part_2' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.travis2; fi"
5457
# Integration integrity tests
5558
- sh -c "if [ '$TEST_SUITE' = 'integration_integrity' ]; then cd dev/tests/integration/; ./../../../vendor/bin/phpunit -c phpunit.xml.dist testsuite/Magento/Test/Integrity; fi"
5659
# Static tests [Code Style]
5760
- sh -c "if [ '$TEST_SUITE' = 'static_phpcs' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testCodeStyle'; fi"
5861
# Static tests [Code Style]
59-
- sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi"
62+
- sh -c "if [ '$TEST_SUITE' = 'static_annotation' ]; then cd dev/tests/static; ./../../../vendor/bin/phpunit -c phpunit.xml.dist --filter 'Magento\\\\Test\\\\Php\\\\LiveCodeTest::testAnnotationStandard'; fi"

app/code/Magento/Backend/Block/Menu.php

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -455,28 +455,14 @@ public function renderNavigation($menu, $level = 0, $limit = 0, $colBrakes = [])
455455
}
456456

457457
$id = $this->getJsId($menuItem->getId());
458-
if (count($menu) > 1 || $level != 1) {
459-
$output .= '<li ' . $this->getUiId(
460-
$menuItem->getId()
461-
) . ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass(
462-
$menuItem,
463-
$level
464-
) . ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
465-
. '" role="menu-item">' . $this->_renderAnchor(
466-
$menuItem,
467-
$level
468-
) . $this->_addSubMenu(
469-
$menuItem,
470-
$level,
471-
$limit,
472-
$id
473-
) . '</li>';
458+
$subMenu = $this->_addSubMenu($menuItem, $level, $limit, $id);
459+
if (count($menu) > 1 || $level != 1 || $menuItem->getUrl() !== '#') {
460+
$output .= '<li ' . $this->getUiId($menuItem->getId())
461+
. ' class="item-' . $itemClass . ' ' . $this->_renderItemCssClass($menuItem, $level)
462+
. ($level == 0 ? '" id="' . $id . '" aria-haspopup="true' : '')
463+
. '" role="menu-item">' . $this->_renderAnchor($menuItem, $level) . $subMenu . '</li>';
474464
} else {
475-
$output .= $this->_addSubMenu(
476-
$menuItem,
477-
$level,
478-
$limit,
479-
$id);
465+
$output .= $subMenu;
480466
}
481467

482468
$itemPosition++;

app/code/Magento/Backend/Block/Widget/Button/Item.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,25 @@
1616
*/
1717
class Item extends \Magento\Framework\Object
1818
{
19+
/**
20+
* Object delete flag
21+
*
22+
* @var bool
23+
*/
24+
protected $_isDeleted = false;
25+
26+
/**
27+
* Set _isDeleted flag value (if $isDeleted parameter is defined) and return current flag value
28+
*
29+
* @param boolean $isDeleted
30+
* @return bool
31+
*/
32+
public function isDeleted($isDeleted = null)
33+
{
34+
$result = $this->_isDeleted;
35+
if ($isDeleted !== null) {
36+
$this->_isDeleted = $isDeleted;
37+
}
38+
return $result;
39+
}
1940
}

app/code/Magento/Backend/Block/Widget/Form.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ public function setForm(\Magento\Framework\Data\Form $form)
111111
$this->_form = $form;
112112
$this->_form->setParent($this);
113113
$this->_form->setBaseUrl($this->_urlBuilder->getBaseUrl());
114+
115+
$customAttributes = $this->getData('custom_attributes');
116+
if (is_array($customAttributes)) {
117+
foreach ($customAttributes as $key => $value) {
118+
$this->_form->addCustomAttribute($key, $value);
119+
}
120+
}
114121
return $this;
115122
}
116123

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Backend\Test\Unit\Block\Widget;
7+
8+
use Magento\Backend\Block\Template\Context;
9+
use Magento\Backend\Block\Widget\Form;
10+
use Magento\Framework\Data\Form as DataForm;
11+
use Magento\Framework\UrlInterface;
12+
13+
class FormTest extends \PHPUnit_Framework_TestCase
14+
{
15+
/** @var Form */
16+
protected $model;
17+
18+
/** @var Context |\PHPUnit_Framework_MockObject_MockObject */
19+
protected $context;
20+
21+
/** @var DataForm |\PHPUnit_Framework_MockObject_MockObject */
22+
protected $dataForm;
23+
24+
/** @var UrlInterface |\PHPUnit_Framework_MockObject_MockObject */
25+
protected $urlBuilder;
26+
27+
protected function setUp()
28+
{
29+
$this->prepareContext();
30+
31+
$this->dataForm = $this->getMockBuilder('Magento\Framework\Data\Form')
32+
->disableOriginalConstructor()
33+
->setMethods([
34+
'setParent',
35+
'setBaseUrl',
36+
'addCustomAttribute',
37+
])
38+
->getMock();
39+
40+
$this->model = new Form(
41+
$this->context
42+
);
43+
}
44+
45+
protected function prepareContext()
46+
{
47+
$this->urlBuilder = $this->getMockBuilder('Magento\Framework\UrlInterface')
48+
->getMock();
49+
50+
$this->context = $this->getMockBuilder('Magento\Backend\Block\Template\Context')
51+
->disableOriginalConstructor()
52+
->getMock();
53+
$this->context->expects($this->any())
54+
->method('getUrlBuilder')
55+
->willReturn($this->urlBuilder);
56+
}
57+
58+
public function testSetForm()
59+
{
60+
$baseUrl = 'base_url';
61+
$attributeKey = 'attribute_key';
62+
$attributeValue = 'attribute_value';
63+
64+
$this->dataForm->expects($this->once())
65+
->method('setParent')
66+
->with($this->model)
67+
->willReturnSelf();
68+
$this->dataForm->expects($this->once())
69+
->method('setBaseUrl')
70+
->with($baseUrl)
71+
->willReturnSelf();
72+
$this->dataForm->expects($this->once())
73+
->method('addCustomAttribute')
74+
->with($attributeKey, $attributeValue)
75+
->willReturnSelf();
76+
77+
$this->urlBuilder->expects($this->once())
78+
->method('getBaseUrl')
79+
->willReturn($baseUrl);
80+
81+
$this->model->setData('custom_attributes', [$attributeKey => $attributeValue]);
82+
$this->assertEquals($this->model, $this->model->setForm($this->dataForm));
83+
}
84+
85+
public function testSetFormNoCustomAttributes()
86+
{
87+
$baseUrl = 'base_url';
88+
89+
$this->dataForm->expects($this->once())
90+
->method('setParent')
91+
->with($this->model)
92+
->willReturnSelf();
93+
$this->dataForm->expects($this->once())
94+
->method('setBaseUrl')
95+
->with($baseUrl)
96+
->willReturnSelf();
97+
98+
$this->urlBuilder->expects($this->once())
99+
->method('getBaseUrl')
100+
->willReturn($baseUrl);
101+
102+
$this->assertEquals($this->model, $this->model->setForm($this->dataForm));
103+
}
104+
}

app/code/Magento/Backup/Model/Resource/Db.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function getTableStatus($tableName)
124124

125125
if ($row) {
126126
$statusObject = new \Magento\Framework\Object();
127-
$statusObject->setIdFieldName('name');
128127
foreach ($row as $field => $value) {
129128
$statusObject->setData(strtolower($field), $value);
130129
}

app/code/Magento/Bundle/Model/Option.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ protected function _construct()
5353
*/
5454
public function addSelection(\Magento\Catalog\Model\Product $selection)
5555
{
56-
$selections = $this->getDataSetDefault('selections', []);
56+
if (!$this->hasData('selections')) {
57+
$this->setData('selections', []);
58+
}
59+
$selections = $this->getData('selections');
5760
$selections[] = $selection;
5861
$this->setSelections($selections);
5962
}

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/checkbox.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
class="change-container-classname admin__control-checkbox checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>"
3535
id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"
3636
type="checkbox"
37-
name="bundle_option[<?php echo $_option->getId() ?>]"
37+
name="bundle_option[<?php echo $_option->getId() ?>][<?php echo $_selection->getId() ?>]"
3838
<?php if ($block->isSelected($_selection)):?>
3939
<?php echo ' checked="checked"'; ?>
4040
<?php endif;?>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/multi.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
price="<?php echo $block->getSelectionPrice($_selections[0]) ?>" />
2222
<?php else: ?>
2323
<select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>"
24-
name="bundle_option[<?php echo $_option->getId() ?>]"
24+
name="bundle_option[<?php echo $_option->getId() ?>][]"
2525
class="admin__control-multiselect bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> multiselect change-container-classname"
2626
onchange="ProductConfigure.bundleControl.changeSelection(this)">
2727
<?php if(!$_option->getRequired()): ?>

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/multi.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<select multiple="multiple"
2525
size="5"
2626
id="bundle-option-<?php echo $_option->getId() ?>"
27-
name="bundle_option[<?php echo $_option->getId() ?>]"
27+
name="bundle_option[<?php echo $_option->getId() ?>][]"
2828
class="bundle-option-<?php echo $_option->getId() ?> multiselect product bundle option change-container-classname"
2929
<?php if ($_option->getRequired()) echo 'data-validate={required:true}' ?>>
3030
<?php if(!$_option->getRequired()): ?>

0 commit comments

Comments
 (0)