Skip to content

Commit ea1c57c

Browse files
committed
Merge pull request #40 from magento-mpi/public-pulls
[Github] Merge public Github commits
2 parents 5dde4a3 + 2da98de commit ea1c57c

File tree

23 files changed

+155
-51
lines changed

23 files changed

+155
-51
lines changed

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice.php renamed to app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
*
1111
* @SuppressWarnings(PHPMD.LongVariable)
1212
*/
13-
class Groupprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Groupprice\AbstractGroupprice
13+
class GroupPrice extends \Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice
1414
{
1515
/**
1616
* Catalog product attribute backend groupprice
1717
*
18-
* @var \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice
18+
* @var \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice
1919
*/
20-
protected $_productAttributeBackendGroupprice;
20+
protected $_productAttributeBackendGroupPrice;
2121

2222
/**
2323
* @param \Magento\Directory\Model\CurrencyFactory $currencyFactory
@@ -26,7 +26,7 @@ class Groupprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Groupp
2626
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
2727
* @param \Magento\Catalog\Model\Product\Type $catalogProductType
2828
* @param \Magento\Customer\Api\GroupManagementInterface $groupManagement
29-
* @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice
29+
* @param \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice $productAttributeBackendGroupPrice
3030
*/
3131
public function __construct(
3232
\Magento\Directory\Model\CurrencyFactory $currencyFactory,
@@ -35,9 +35,9 @@ public function __construct(
3535
\Magento\Framework\App\Config\ScopeConfigInterface $config,
3636
\Magento\Catalog\Model\Product\Type $catalogProductType,
3737
\Magento\Customer\Api\GroupManagementInterface $groupManagement,
38-
\Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice $productAttributeBackendGroupprice
38+
\Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice $productAttributeBackendGroupPrice
3939
) {
40-
$this->_productAttributeBackendGroupprice = $productAttributeBackendGroupprice;
40+
$this->_productAttributeBackendGroupPrice = $productAttributeBackendGroupPrice;
4141
parent::__construct(
4242
$currencyFactory,
4343
$storeManager,
@@ -51,11 +51,11 @@ public function __construct(
5151
/**
5252
* Retrieve resource instance
5353
*
54-
* @return \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice
54+
* @return \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice
5555
*/
5656
protected function _getResource()
5757
{
58-
return $this->_productAttributeBackendGroupprice;
58+
return $this->_productAttributeBackendGroupPrice;
5959
}
6060

6161
/**

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php renamed to app/code/Magento/Catalog/Model/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Catalog\Model\Product\Attribute\Backend\Groupprice;
6+
namespace Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice;
77

88
use Magento\Catalog\Model\Product\Attribute\Backend\Price;
99
use Magento\Customer\Api\GroupManagementInterface;
1010

1111
/**
1212
* Catalog product abstract group price backend attribute model
1313
*/
14-
abstract class AbstractGroupprice extends Price
14+
abstract class AbstractGroupPrice extends Price
1515
{
1616
/**
1717
* Website currency codes and rates
@@ -100,7 +100,7 @@ protected function _getWebsiteCurrencyRates()
100100
/**
101101
* Retrieve resource instance
102102
*
103-
* @return \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice
103+
* @return \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice
104104
*/
105105
abstract protected function _getResource();
106106

app/code/Magento/Catalog/Model/Product/Attribute/Backend/Tierprice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
namespace Magento\Catalog\Model\Product\Attribute\Backend;
1313

14-
class Tierprice extends \Magento\Catalog\Model\Product\Attribute\Backend\Groupprice\AbstractGroupprice
14+
class Tierprice extends \Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice
1515
{
1616
/**
1717
* Catalog product attribute backend tierprice

app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice.php renamed to app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/GroupPrice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\Catalog\Model\Resource\Product\Attribute\Backend;
77

8-
use Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice\AbstractGroupprice;
8+
use Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice;
99

1010
/**
1111
* Catalog product group price backend attribute model
1212
*
1313
* @author Magento Core Team <core@magentocommerce.com>
1414
*/
15-
class Groupprice extends AbstractGroupprice
15+
class GroupPrice extends AbstractGroupPrice
1616
{
1717
/**
1818
* Initialize connection and define main table

app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Groupprice/AbstractGroupprice.php renamed to app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/GroupPrice/AbstractGroupPrice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
*
1010
* @author Magento Core Team <core@magentocommerce.com>
1111
*/
12-
namespace Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice;
12+
namespace Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice;
1313

14-
abstract class AbstractGroupprice extends \Magento\Framework\Model\Resource\Db\AbstractDb
14+
abstract class AbstractGroupPrice extends \Magento\Framework\Model\Resource\Db\AbstractDb
1515
{
1616
/**
1717
* Load Tier Prices for product

app/code/Magento/Catalog/Model/Resource/Product/Attribute/Backend/Tierprice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
*/
66
namespace Magento\Catalog\Model\Resource\Product\Attribute\Backend;
77

8-
use Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice\AbstractGroupprice;
8+
use Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice;
99

1010
/**
1111
* Catalog product tier price backend attribute model
1212
*
1313
* @author Magento Core Team <core@magentocommerce.com>
1414
*/
15-
class Tierprice extends AbstractGroupprice
15+
class Tierprice extends AbstractGroupPrice
1616
{
1717
/**
1818
* Initialize connection and define main table

app/code/Magento/Catalog/Model/Resource/Setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ public function getDefaultEntities()
561561
'type' => 'decimal',
562562
'label' => 'Group Price',
563563
'input' => 'text',
564-
'backend' => 'Magento\Catalog\Model\Product\Attribute\Backend\Groupprice',
564+
'backend' => 'Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice',
565565
'required' => false,
566566
'sort_order' => 2,
567567
'global' => \Magento\Catalog\Model\Resource\Eav\Attribute::SCOPE_WEBSITE,

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ define([
6161
*/
6262
_renderSelectOption: function(selectElement, key, value) {
6363
selectElement.append($.proxy(function() {
64-
if (value.code && $(value.name).is('span')) {
64+
var name = value.name.replace(/[!"#$%&'()*+,.\/:;<=>?@[\\\]^`{|}~]/g, "\\$&");
65+
if (value.code && $(name).is('span')) {
6566
key = value.code;
66-
value.name = $(value.name).text();
67+
value.name = $(name).text();
6768
}
6869
$.template('regionTemplate', this.options.regionTemplate);
6970
if (this.options.defaultRegion === key) {
@@ -173,4 +174,4 @@ define([
173174
});
174175

175176
return $.mage.regionUpdater;
176-
});
177+
});

app/code/Magento/Ui/DataProvider/Config/FileResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function get($filename, $scope)
4646
{
4747
$iterator = $this->iteratorFactory->create(
4848
$this->directoryRead,
49-
$this->directoryRead->search('/*/*/etc/data_source/*')
49+
$this->directoryRead->search('/*/*/etc/data_source/' . $filename)
5050
);
5151
return $iterator;
5252
}

dev/shell/cache.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,20 @@
1515

1616
$usage = 'Usage: php -f cache.php -- [--' . ManagerApp::KEY_SET . '=1|0]'
1717
. ' [--' . ManagerApp::KEY_CLEAN . ']'
18+
. ' [--' . ManagerApp::KEY_STATUS . ']'
1819
. ' [--' . ManagerApp::KEY_FLUSH . ']'
1920
. ' [--' . ManagerApp::KEY_TYPES . '=<type1>,<type2>,...]'
2021
. ' [--bootstrap=' . escapeshellarg('INIT_PARAM=foo&ANOTHER_PARAM[key]=bar') . ']
2122
--' . ManagerApp::KEY_TYPES . ' - list of cache types, comma-separated. If omitted, all caches will be affected
2223
--' . ManagerApp::KEY_SET . ' - enable or disable the specified cache types
2324
--' . ManagerApp::KEY_CLEAN . ' - clean data of the specified cache types
25+
--' . ManagerApp::KEY_STATUS . ' - display current status for each cache type
2426
--' . ManagerApp::KEY_FLUSH . ' - destroy all data in storage that the specified cache types reside on
2527
--bootstrap - add or override parameters of the bootstrap' . PHP_EOL;
2628
$longOpts = [
2729
ManagerApp::KEY_SET . '::',
2830
ManagerApp::KEY_CLEAN,
31+
ManagerApp::KEY_STATUS,
2932
ManagerApp::KEY_FLUSH,
3033
ManagerApp::KEY_TYPES . '::',
3134
'bootstrap::',

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntity.php renamed to dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/UpdateCustomerFrontendEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
4040
*/
41-
class UpdateCustomerFrontendEntity extends Injectable
41+
class UpdateCustomerFrontendEntityTest extends Injectable
4242
{
4343
/**
4444
* Factory for Fixtures
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
"customer/data/firstname";"customer/data/lastname";"customer/data/email";"address/data/firstname";"address/data/lastname";"address/data/company";"address/data/street";"address/data/city";"address/data/country_id";"address/data/region_id";"address/data/region";"address/data/telephone";"address/data/fax";"address/data/postcode";"constraint"
22
"Jany %isolation%";"Doe %isolation%";"janydoe%isolation%@example.com";"Jany %isolation%";"Doe %isolation%";"Company %isolation%";"Some street %isolation%";"City %isolation%";"United States";"Colorado";"-";"555-888-111-999";"161-999-8888";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses"
33
"Jonny %isolation%";"Doe %isolation%";"jonny%isolation%@example.com";"John %isolation%";"Doe %isolation%";"Company %isolation%";"Some street %isolation%";"City %isolation%";"United Kingdom";"-";"Region %isolation%";"0123456789-02134567";"5555-874-99634";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses"
4+
"Jean %isolation%";"Reno %isolation%";"jean%isolation%@example.com";"Jean %isolation%";"Reno %isolation%";"Magento %isolation%";"18-20 Rue Maréchal Leclerc";"Quintin";"France";"Côtes-d'Armor";"-";"555-888-111-999";"161-999-8888";"12345";"assertCustomerAddressSuccessSaveMessage, assertCustomerDefaultAddresses"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Framework\View\Page\Config\Reader;
7+
8+
class HtmlTest extends \PHPUnit_Framework_TestCase
9+
{
10+
public function testInterpret()
11+
{
12+
/** @var \Magento\Framework\View\Layout\Reader\Context $readerContext */
13+
$readerContext = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
14+
'Magento\Framework\View\Layout\Reader\Context'
15+
);
16+
$pageXml = new \Magento\Framework\View\Layout\Element(__DIR__ . '/_files/_layout_update.xml', 0, true);
17+
$parentElement = new \Magento\Framework\View\Layout\Element('<page></page>');
18+
19+
$html = new Html();
20+
foreach ($pageXml->xpath('html') as $htmlElement) {
21+
$html->interpret($readerContext, $htmlElement, $parentElement);
22+
}
23+
24+
$structure = $readerContext->getPageConfigStructure();
25+
$this->assertEquals(['html' => ['test-name' => 'test-value']], $structure->getElementAttributes());
26+
}
27+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
9+
<html>
10+
<attribute name="test-name" value="test-value"/>
11+
</html>
12+
</page>

dev/tests/unit/testsuite/Magento/Bundle/Pricing/Price/GroupPriceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GroupPriceTest extends \PHPUnit_Framework_TestCase
4343
protected $attributeMock;
4444

4545
/**
46-
* @var \Magento\Catalog\Model\Product\Attribute\Backend\Groupprice|\PHPUnit_Framework_MockObject_MockObject
46+
* @var \Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice|\PHPUnit_Framework_MockObject_MockObject
4747
*/
4848
protected $backendMock;
4949

@@ -110,7 +110,7 @@ public function setUp()
110110
false
111111
);
112112
$this->backendMock = $this->getMock(
113-
'Magento\Catalog\Model\Product\Attribute\Backend\Groupprice',
113+
'Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice',
114114
[],
115115
[],
116116
'',
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
* Copyright © 2015 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
namespace Magento\Catalog\Model\Product\Attribute\Backend\Groupprice;
6+
namespace Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice;
77

88
class AbstractTest extends \PHPUnit_Framework_TestCase
99
{
1010
/**
11-
* @var \Magento\Catalog\Model\Resource\Product\Attribute\Backend\Groupprice\AbstractGroupprice
11+
* @var \Magento\Catalog\Model\Resource\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice
1212
*/
1313
protected $_model;
1414

@@ -31,7 +31,7 @@ protected function setUp()
3131
$groupManagement = $this->getMock('Magento\Customer\Api\GroupManagementInterface', [], [], '', false);
3232

3333
$this->_model = $this->getMockForAbstractClass(
34-
'Magento\Catalog\Model\Product\Attribute\Backend\Groupprice\AbstractGroupprice',
34+
'Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice\AbstractGroupPrice',
3535
[
3636
'currencyFactory' => $currencyFactoryMock,
3737
'storeManager' => $storeManagerMock,

dev/tests/unit/testsuite/Magento/Catalog/Pricing/Price/GroupPriceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class GroupPriceTest extends \PHPUnit_Framework_TestCase
4747
protected $attributeMock;
4848

4949
/**
50-
* @var \Magento\Catalog\Model\Product\Attribute\Backend\Groupprice|\PHPUnit_Framework_MockObject_MockObject
50+
* @var \Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice|\PHPUnit_Framework_MockObject_MockObject
5151
*/
5252
protected $backendMock;
5353

@@ -104,7 +104,7 @@ public function setUp()
104104
false
105105
);
106106
$this->backendMock = $this->getMock(
107-
'Magento\Catalog\Model\Product\Attribute\Backend\Groupprice',
107+
'Magento\Catalog\Model\Product\Attribute\Backend\GroupPrice',
108108
[],
109109
[],
110110
'',

dev/tests/unit/testsuite/Magento/Framework/App/Cache/ManagerAppTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ protected function setUp()
3232

3333
public function testLaunchStatus()
3434
{
35+
$requestArgs = [
36+
ManagerApp::KEY_STATUS => true
37+
];
38+
3539
$this->response->expects($this->once())
3640
->method('setBody')
3741
->with(
3842
$this->matches("Current status:%afoo: 1%abar: 1%abaz: 0")
3943
);
4044

41-
$model = new ManagerApp($this->cacheManager, $this->response, []);
45+
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
4246
$model->launch();
4347
}
4448

@@ -58,7 +62,7 @@ public function testLaunchEnable()
5862
$this->response->expects($this->once())
5963
->method('setBody')
6064
->with(
61-
$this->matches("Changed cache status:%abaz: 0 -> 1%aCleaned cache types: baz%a")
65+
$this->matches("Changed cache status:\n%abaz: 0 -> 1\nCleaned cache types:\nbaz")
6266
);
6367

6468
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
@@ -80,7 +84,7 @@ public function testLaunchDisable()
8084
$this->response->expects($this->once())
8185
->method('setBody')
8286
->with(
83-
$this->matches("Changed cache status:%abaz: 1 -> 0%a%a")
87+
$this->matches("Changed cache status:\n%abaz: 1 -> 0\n")
8488
);
8589

8690
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
@@ -103,7 +107,7 @@ public function testLaunchFlush()
103107
$this->response->expects($this->once())
104108
->method('setBody')
105109
->with(
106-
$this->matches("Flushed cache types: foo, bar%a")
110+
$this->matches("Flushed cache types:\nfoo\nbar")
107111
);
108112

109113
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
@@ -126,7 +130,7 @@ public function testLaunchClean()
126130
$this->response->expects($this->once())
127131
->method('setBody')
128132
->with(
129-
$this->matches("Cleaned cache types: foo, bar%a")
133+
$this->matches("Cleaned cache types:\nfoo\nbar")
130134
);
131135

132136
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
@@ -152,7 +156,7 @@ public function testLaunchSetAndClean()
152156
$this->response->expects($this->once())
153157
->method('setBody')
154158
->with(
155-
$this->matches("Changed cache status:%afoo: 0 -> 1%aCleaned cache types: foo, bar%a")
159+
$this->matches("Changed cache status:\n%afoo: 0 -> 1\nCleaned cache types:\nfoo\nbar")
156160
);
157161

158162
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);
@@ -179,7 +183,7 @@ public function testLaunchAll()
179183
$this->response->expects($this->once())
180184
->method('setBody')
181185
->with(
182-
$this->matches("Changed cache status:%abaz: 0 -> 1%aFlushed cache types: foo, baz%a")
186+
$this->matches("Changed cache status:\n%abaz: 0 -> 1%aFlushed cache types:\nfoo\nbaz")
183187
);
184188

185189
$model = new ManagerApp($this->cacheManager, $this->response, $requestArgs);

0 commit comments

Comments
 (0)