Skip to content

Commit 7b92679

Browse files
committed
Merge branch 'develop' of github.com:magento/magento2ce into troll_pr
2 parents 17ddf57 + b4c3bfd commit 7b92679

File tree

174 files changed

+4221
-3364
lines changed

Some content is hidden

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

174 files changed

+4221
-3364
lines changed

app/code/Magento/Backend/Model/Session/Quote.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
use Magento\Customer\Api\CustomerRepositoryInterface;
99
use Magento\Customer\Api\GroupManagementInterface;
10-
use Magento\Framework\App\ObjectManager;
11-
use Magento\Quote\Api\CartManagementInterface;
1210

1311
/**
1412
* Adminhtml quote session
@@ -81,11 +79,6 @@ class Quote extends \Magento\Framework\Session\SessionManager
8179
*/
8280
protected $quoteFactory;
8381

84-
/**
85-
* @var \Magento\Quote\Api\CartManagementInterface;
86-
*/
87-
private $cartManagement;
88-
8982
/**
9083
* @param \Magento\Framework\App\Request\Http $request
9184
* @param \Magento\Framework\Session\SidResolverInterface $sidResolver

app/code/Magento/Backend/Model/Url.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Model;
77

8+
use Magento\Framework\Url\HostChecker;
9+
use Magento\Framework\App\ObjectManager;
810

911
/**
1012
* Class \Magento\Backend\Model\UrlInterface
@@ -77,6 +79,8 @@ class Url extends \Magento\Framework\Url implements \Magento\Backend\Model\UrlIn
7779
protected $_scope;
7880

7981
/**
82+
* Constructor
83+
*
8084
* @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
8185
* @param \Magento\Framework\App\RequestInterface $request
8286
* @param \Magento\Framework\Url\SecurityInfoInterface $urlSecurityInfo
@@ -96,7 +100,7 @@ class Url extends \Magento\Framework\Url implements \Magento\Backend\Model\UrlIn
96100
* @param \Magento\Store\Model\StoreFactory $storeFactory
97101
* @param \Magento\Framework\Data\Form\FormKey $formKey
98102
* @param array $data
99-
*
103+
* @param HostChecker|null $hostChecker
100104
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
101105
*/
102106
public function __construct(
@@ -118,9 +122,11 @@ public function __construct(
118122
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
119123
\Magento\Store\Model\StoreFactory $storeFactory,
120124
\Magento\Framework\Data\Form\FormKey $formKey,
121-
array $data = []
125+
array $data = [],
126+
HostChecker $hostChecker = null
122127
) {
123128
$this->_encryptor = $encryptor;
129+
$hostChecker = $hostChecker ?: ObjectManager::getInstance()->get(HostChecker::class);
124130
parent::__construct(
125131
$routeConfig,
126132
$request,
@@ -133,7 +139,8 @@ public function __construct(
133139
$scopeConfig,
134140
$routeParamsPreprocessor,
135141
$scopeType,
136-
$data
142+
$data,
143+
$hostChecker
137144
);
138145
$this->_backendHelper = $backendHelper;
139146
$this->_menuConfig = $menuConfig;

app/code/Magento/Backend/Test/Unit/Model/Session/QuoteTest.php

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
*/
1313
class QuoteTest extends \PHPUnit_Framework_TestCase
1414
{
15+
/**
16+
* @var \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
17+
*/
18+
private $objectManager;
19+
1520
/**
1621
* @var \Magento\Store\Model\StoreManagerInterface|\PHPUnit_Framework_MockObject_MockObject
1722
*/
@@ -92,11 +97,6 @@ class QuoteTest extends \PHPUnit_Framework_TestCase
9297
*/
9398
protected $quoteFactoryMock;
9499

95-
/**
96-
* @var \PHPUnit_Framework_MockObject_MockObject
97-
*/
98-
protected $cartManagementMock;
99-
100100
/**
101101
* Set up
102102
*
@@ -105,6 +105,7 @@ class QuoteTest extends \PHPUnit_Framework_TestCase
105105
*/
106106
protected function setUp()
107107
{
108+
$this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
108109
$this->customerRepositoryMock = $this->getMockForAbstractClass(
109110
\Magento\Customer\Api\CustomerRepositoryInterface::class,
110111
[],
@@ -197,13 +198,6 @@ protected function setUp()
197198
);
198199

199200
$this->quoteFactoryMock = $this->getMock(\Magento\Quote\Model\QuoteFactory::class, ['create'], [], '', false);
200-
$this->cartManagementMock = $this->getMock(
201-
\Magento\Quote\Api\CartManagementInterface::class,
202-
[],
203-
[],
204-
'',
205-
false
206-
);
207201

208202
$this->quote = $this->getMock(
209203
\Magento\Backend\Model\Session\Quote::class,
@@ -226,10 +220,6 @@ protected function setUp()
226220
'quoteFactory' => $this->quoteFactoryMock
227221
]
228222
);
229-
230-
$this->prepareObjectManager([
231-
[\Magento\Quote\Api\CartManagementInterface::class, $this->cartManagementMock]
232-
]);
233223
}
234224

235225
/**
@@ -416,19 +406,4 @@ public function getQuoteDataProvider()
416406
'customer ids same' => [66, 66, 'never'],
417407
];
418408
}
419-
420-
/**
421-
* @param array $map
422-
* @deprecated
423-
*/
424-
private function prepareObjectManager($map)
425-
{
426-
$objectManagerMock = $this->getMock(\Magento\Framework\ObjectManagerInterface::class);
427-
$objectManagerMock->expects($this->any())->method('getInstance')->willReturnSelf();
428-
$objectManagerMock->expects($this->any())->method('get')->will($this->returnValueMap($map));
429-
$reflectionClass = new \ReflectionClass(\Magento\Framework\App\ObjectManager::class);
430-
$reflectionProperty = $reflectionClass->getProperty('_instance');
431-
$reflectionProperty->setAccessible(true);
432-
$reflectionProperty->setValue($objectManagerMock);
433-
}
434409
}

app/code/Magento/Backend/Test/Unit/Model/UrlTest.php

Lines changed: 19 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
* Copyright © 2016 Magento. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
7-
// @codingStandardsIgnoreFile
8-
9-
/**
10-
* Test class for \Magento\Backend\Model\Url
11-
*/
126
namespace Magento\Backend\Test\Unit\Model;
137

8+
use Magento\Framework\Url\HostChecker;
9+
1410
/**
1511
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
12+
* @codingStandardsIgnoreFile
1613
*/
1714
class UrlTest extends \PHPUnit_Framework_TestCase
1815
{
@@ -21,10 +18,12 @@ class UrlTest extends \PHPUnit_Framework_TestCase
2118
*/
2219
protected $_model;
2320

21+
/**
22+
* @var string
23+
*/
2424
protected $_areaFrontName = 'backendArea';
2525

2626
/**
27-
* Mock menu model
2827
* @var \PHPUnit_Framework_MockObject_MockObject
2928
*/
3029
protected $_menuMock;
@@ -62,7 +61,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase
6261
/**
6362
* @var \PHPUnit_Framework_MockObject_MockObject
6463
*/
65-
protected $_paramsResolverMock;
64+
protected $routeParamsResolverFactoryMock;
6665

6766
/**
6867
* @var \Magento\Framework\Encryption\EncryptorInterface
@@ -75,6 +74,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase
7574
*/
7675
protected function setUp()
7776
{
77+
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
7878
$this->_menuMock = $this->getMock(
7979
\Magento\Backend\Model\Menu::class,
8080
[],
@@ -141,25 +141,21 @@ protected function setUp()
141141
false,
142142
false
143143
);
144-
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
145144
$this->_encryptor = $this->getMock(\Magento\Framework\Encryption\Encryptor::class, null, [], '', false);
146-
$this->_paramsResolverMock = $this->getMock(
145+
$routeParamsResolver = $this->getMock(\Magento\Framework\Url\RouteParamsResolver::class, [], [], '', false);
146+
$this->routeParamsResolverFactoryMock = $this->getMock(
147147
\Magento\Framework\Url\RouteParamsResolverFactory::class,
148148
[],
149149
[],
150150
'',
151151
false
152152
);
153-
$this->_paramsResolverMock->expects(
154-
$this->any()
155-
)->method(
156-
'create'
157-
)->will(
158-
$this->returnValue(
159-
$this->getMock(\Magento\Framework\Url\RouteParamsResolver::class, [], [], '', false)
160-
)
161-
);
162-
$this->_model = $helper->getObject(
153+
$this->routeParamsResolverFactoryMock->expects($this->any())
154+
->method('create')
155+
->willReturn($routeParamsResolver);
156+
/** @var HostChecker|\PHPUnit_Framework_MockObject_MockObject $hostCheckerMock */
157+
$hostCheckerMock = $this->getMock(HostChecker::class, [], [], '', false);
158+
$this->_model = $objectManager->getObject(
163159
\Magento\Backend\Model\Url::class,
164160
[
165161
'scopeConfig' => $this->_scopeConfigMock,
@@ -168,31 +164,10 @@ protected function setUp()
168164
'menuConfig' => $this->_menuConfigMock,
169165
'authSession' => $this->_authSessionMock,
170166
'encryptor' => $this->_encryptor,
171-
'routeParamsResolverFactory' => $this->_paramsResolverMock
167+
'routeParamsResolverFactory' => $this->routeParamsResolverFactoryMock,
168+
'hostChecker' => $hostCheckerMock
172169
]
173170
);
174-
$this->_paramsResolverMock->expects(
175-
$this->any()
176-
)->method(
177-
'create'
178-
)->will(
179-
$this->returnValue(
180-
$this->getMock(\Magento\Framework\Url\RouteParamsResolver::class, [], [], '', false)
181-
)
182-
);
183-
$this->_model = $helper->getObject(
184-
\Magento\Backend\Model\Url::class,
185-
[
186-
'scopeConfig' => $this->_scopeConfigMock,
187-
'backendHelper' => $helperMock,
188-
'formKey' => $this->_formKey,
189-
'menuConfig' => $this->_menuConfigMock,
190-
'authSession' => $this->_authSessionMock,
191-
'encryptor' => $this->_encryptor,
192-
'routeParamsResolverFactory' => $this->_paramsResolverMock
193-
]
194-
);
195-
196171
$this->_requestMock = $this->getMock(\Magento\Framework\App\Request\Http::class, [], [], '', false);
197172
$this->_model->setRequest($this->_requestMock);
198173
}
@@ -262,7 +237,7 @@ public function testGetAreaFrontName()
262237
[
263238
'backendHelper' => $helperMock,
264239
'authSession' => $this->_authSessionMock,
265-
'routeParamsResolverFactory' => $this->_paramsResolverMock
240+
'routeParamsResolverFactory' => $this->routeParamsResolverFactoryMock
266241
]
267242
);
268243
$urlModel->getAreaFrontName();

app/code/Magento/BundleImportExport/Model/Import/Product/Type/Bundle.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
namespace Magento\BundleImportExport\Model\Import\Product\Type;
1010

1111
use \Magento\Bundle\Model\Product\Price as BundlePrice;
12-
use \Magento\BundleImportExport\Model\Export\RowCustomizer;
1312
use \Magento\Catalog\Model\Product\Type\AbstractType;
1413

1514
/**
@@ -55,20 +54,6 @@ class Bundle extends \Magento\CatalogImportExport\Model\Import\Product\Type\Abst
5554
*/
5655
const SELECTION_PRICE_TYPE_PERCENT = 1;
5756

58-
/**
59-
* Instance of database adapter.
60-
*
61-
* @var \Magento\Framework\DB\Adapter\AdapterInterface
62-
*/
63-
protected $connection;
64-
65-
/**
66-
* Instance of application resource.
67-
*
68-
* @var \Magento\Framework\App\ResourceConnection
69-
*/
70-
protected $_resource;
71-
7257
/**
7358
* Array of cached options.
7459
*
@@ -144,23 +129,6 @@ class Bundle extends \Magento\CatalogImportExport\Model\Import\Product\Type\Abst
144129
'multiselect' => 'multi',
145130
];
146131

147-
/**
148-
* @param \Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $attrSetColFac
149-
* @param \Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $prodAttrColFac
150-
* @param \Magento\Framework\App\ResourceConnection $resource
151-
* @param array $params
152-
*/
153-
public function __construct(
154-
\Magento\Eav\Model\ResourceModel\Entity\Attribute\Set\CollectionFactory $attrSetColFac,
155-
\Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory $prodAttrColFac,
156-
\Magento\Framework\App\ResourceConnection $resource,
157-
array $params
158-
) {
159-
parent::__construct($attrSetColFac, $prodAttrColFac, $resource, $params);
160-
$this->_resource = $resource;
161-
$this->connection = $resource->getConnection(\Magento\Framework\App\ResourceConnection::DEFAULT_CONNECTION);
162-
}
163-
164132
/**
165133
* Parse selections.
166134
*

app/code/Magento/BundleImportExport/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"magento/module-import-export": "100.2.*",
88
"magento/module-catalog-import-export": "100.2.*",
99
"magento/module-bundle": "100.2.*",
10-
"magento/module-eav": "100.2.*",
1110
"magento/framework": "100.2.*"
1211
},
1312
"type": "magento2-module",
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
11
<?php
22
/**
3-
* Catalog attributes configuration data container. Provides catalog attributes configuration data.
4-
*
53
* Copyright © 2016 Magento. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
86
namespace Magento\Catalog\Model\Attribute\Config;
97

8+
use Magento\Framework\Serialize\SerializerInterface;
9+
10+
/**
11+
* Provides catalog attributes configuration
12+
*/
1013
class Data extends \Magento\Framework\Config\Data
1114
{
1215
/**
16+
* Constructor
17+
*
1318
* @param \Magento\Catalog\Model\Attribute\Config\Reader $reader
1419
* @param \Magento\Framework\Config\CacheInterface $cache
20+
* @param string|null $cacheId
21+
* @param SerializerInterface|null $serializer
1522
*/
1623
public function __construct(
1724
\Magento\Catalog\Model\Attribute\Config\Reader $reader,
18-
\Magento\Framework\Config\CacheInterface $cache
25+
\Magento\Framework\Config\CacheInterface $cache,
26+
$cacheId = 'catalog_attributes',
27+
SerializerInterface $serializer = null
1928
) {
20-
parent::__construct($reader, $cache, 'catalog_attributes');
29+
parent::__construct($reader, $cache, $cacheId, $serializer);
2130
}
2231
}

0 commit comments

Comments
 (0)