Skip to content

Commit 399d22b

Browse files
author
Gurzhyi, Andrii
committed
Merge branch 'develop' of github.corp.magento.com:magento2/magento2ce into MAGETWO-43491
Conflicts: dev/tests/functional/tests/app/Magento/Braintree/Test/TestCase/OnePageCheckoutTest.xml
2 parents 46db57d + 5d531a6 commit 399d22b

File tree

187 files changed

+2638
-1113
lines changed

Some content is hidden

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

187 files changed

+2638
-1113
lines changed

app/code/Magento/CatalogSearch/Model/Adapter/Mysql/Filter/Preprocessor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function processQueryWithField(FilterInterface $filter, $isNegation, $qu
107107
$query
108108
);
109109
} elseif ($filter->getField() === 'category_ids') {
110-
return 'category_ids_index.category_id = ' . $filter->getValue();
110+
return 'category_ids_index.category_id = ' . (int) $filter->getValue();
111111
} elseif ($attribute->isStatic()) {
112112
$alias = $this->tableMapper->getMappingAlias($filter);
113113
$resultQuery = str_replace(
@@ -194,10 +194,10 @@ private function processTermSelect(FilterInterface $filter, $isNegation)
194194
$value = sprintf(
195195
'%s IN (%s)',
196196
($isNegation ? 'NOT' : ''),
197-
implode(',', $filter->getValue())
197+
implode(',', array_map([$this->connection, 'quote'], $filter->getValue()))
198198
);
199199
} else {
200-
$value = ($isNegation ? '!' : '') . '= ' . $filter->getValue();
200+
$value = ($isNegation ? '!' : '') . '= ' . $this->connection->quote($filter->getValue());
201201
}
202202
$resultQuery = sprintf(
203203
'%1$s.value %2$s',

app/code/Magento/CatalogSearch/Test/Unit/Model/Adapter/Mysql/Filter/PreprocessorTest.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function setUp()
104104
->getMock();
105105
$this->connection = $this->getMockBuilder('\Magento\Framework\DB\Adapter\AdapterInterface')
106106
->disableOriginalConstructor()
107-
->setMethods(['select', 'getIfNullSql'])
107+
->setMethods(['select', 'getIfNullSql', 'quote'])
108108
->getMockForAbstractClass();
109109
$this->select = $this->getMockBuilder('\Magento\Framework\DB\Select')
110110
->disableOriginalConstructor()
@@ -170,9 +170,25 @@ public function testProcessPrice()
170170
$this->assertSame($expectedResult, $this->removeWhitespaces($actualResult));
171171
}
172172

173-
public function testProcessCategoryIds()
173+
/**
174+
* @return array
175+
*/
176+
public function processCategoryIdsDataProvider()
177+
{
178+
return [
179+
['5', 'category_ids_index.category_id = 5'],
180+
[3, 'category_ids_index.category_id = 3'],
181+
["' and 1 = 0", 'category_ids_index.category_id = 0'],
182+
];
183+
}
184+
185+
/**
186+
* @param string|int $categoryId
187+
* @param string $expectedResult
188+
* @dataProvider processCategoryIdsDataProvider
189+
*/
190+
public function testProcessCategoryIds($categoryId, $expectedResult)
174191
{
175-
$expectedResult = 'category_ids_index.category_id = FilterValue';
176192
$isNegation = false;
177193
$query = 'SELECT category_ids FROM catalog_product_entity';
178194

@@ -182,7 +198,7 @@ public function testProcessCategoryIds()
182198

183199
$this->filter->expects($this->once())
184200
->method('getValue')
185-
->will($this->returnValue('FilterValue'));
201+
->will($this->returnValue($categoryId));
186202

187203
$this->config->expects($this->exactly(1))
188204
->method('getAttribute')
@@ -249,6 +265,7 @@ public function testProcessTermFilter($frontendInput, $fieldValue, $isNegation,
249265
->method('getValue')
250266
->willReturn($fieldValue);
251267

268+
$this->connection->expects($this->atLeastOnce())->method('quote')->willReturnArgument(0);
252269
$actualResult = $this->target->process($this->filter, $isNegation, 'This filter is not depends on used query');
253270
$this->assertSame($expected, $this->removeWhitespaces($actualResult));
254271
}

app/code/Magento/Config/Model/Config/Structure/Element/Group/Proxy.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66
namespace Magento\Config\Model\Config\Structure\Element\Group;
77

8-
class Proxy extends \Magento\Config\Model\Config\Structure\Element\Group
8+
class Proxy extends \Magento\Config\Model\Config\Structure\Element\Group implements
9+
\Magento\Framework\ObjectManager\NoninterceptableInterface
910
{
1011
/**
1112
* Object manager

app/code/Magento/Config/Model/Config/Structure/Search/Proxy.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
*/
66
namespace Magento\Config\Model\Config\Structure\Search;
77

8-
class Proxy implements \Magento\Config\Model\Config\Structure\SearchInterface
8+
class Proxy implements
9+
\Magento\Config\Model\Config\Structure\SearchInterface,
10+
\Magento\Framework\ObjectManager\NoninterceptableInterface
911
{
1012
/**
1113
* Object manager

app/code/Magento/Deploy/Model/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protected function compile(
161161
DirectoryList::DI,
162162
]
163163
);
164-
$cmd = $this->functionCallPath . 'setup:di:compile-multi-tenant';
164+
$cmd = $this->functionCallPath . 'setup:di:compile';
165165

166166
/**
167167
* exec command is necessary for now to isolate the autoloaders in the compiler from the memory state

app/code/Magento/Newsletter/Test/Unit/Model/Queue/TransportBuilderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ class TransportBuilderTest extends \Magento\Framework\Mail\Test\Unit\Template\Tr
2424
* @param int $templateType
2525
* @param string $messageType
2626
* @param string $bodyText
27+
* @param string $templateNamespace
2728
* @return void
2829
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
30+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2931
*/
3032
public function testGetTransport(
3133
$templateType = TemplateTypesInterface::TYPE_HTML,
3234
$messageType = MessageInterface::TYPE_HTML,
33-
$bodyText = '<h1>Html message</h1>'
35+
$bodyText = '<h1>Html message</h1>',
36+
$templateNamespace = ''
3437
) {
3538
$filter = $this->getMock('Magento\Email\Model\Template\Filter', [], [], '', false);
3639
$data = [

app/code/Magento/PageCache/Model/System/Config/Source/Application.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
*/
1010
namespace Magento\PageCache\Model\System\Config\Source;
1111

12+
use Magento\Framework\Option\ArrayInterface;
13+
use Magento\PageCache\Model\Config;
14+
1215
/**
1316
* Class Application
14-
*
1517
*/
16-
class Application implements \Magento\Framework\Option\ArrayInterface
18+
class Application implements ArrayInterface
1719
{
1820
/**
1921
* Options getter
@@ -24,12 +26,12 @@ public function toOptionArray()
2426
{
2527
return [
2628
[
27-
'value' => \Magento\PageCache\Model\Config::BUILT_IN,
28-
'label' => __('Built-in Application (Not Recommended for Production Use)')
29+
'value' => Config::BUILT_IN,
30+
'label' => __('Built-in Cache')
2931
],
3032
[
31-
'value' => \Magento\PageCache\Model\Config::VARNISH,
32-
'label' => __('Varnish Caching')
33+
'value' => Config::VARNISH,
34+
'label' => __('Varnish Cache (Recommended)')
3335
]
3436
];
3537
}
@@ -42,9 +44,8 @@ public function toOptionArray()
4244
public function toArray()
4345
{
4446
return [
45-
\Magento\PageCache\Model\Config::BUILT_IN =>
46-
__('Built-in Application (Not Recommended for Production Use)'),
47-
\Magento\PageCache\Model\Config::VARNISH => __('Varnish Caching')
47+
Config::BUILT_IN => __('Built-in Cache'),
48+
Config::VARNISH => __('Varnish Cache (Recommended)')
4849
];
4950
}
5051
}

app/code/Magento/PageCache/i18n/en_US.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"Export VCL","Export VCL"
22
"Ttl value ""%1"" is not valid. Please use only numbers equal or greater than zero.","Ttl value ""%1"" is not valid. Please use only numbers equal or greater than zero."
3-
"Built-in Application (Not Recommended for Production Use)","Built-in Application (Not Recommended for Production Use)"
4-
"Varnish Caching","Varnish Caching"
3+
"Built-in Cache","Built-in Cache"
4+
"Varnish Cache (Recommended)","Varnish Cache (Recommended)"
55
"Full Page Cache","Full Page Cache"
66
"Caching Application","Caching Application"
77
"Varnish Configuration","Varnish Configuration"

app/code/Magento/Review/Controller/Product/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public function execute()
3737
$data = $this->getRequest()->getPostValue();
3838
$rating = $this->getRequest()->getParam('ratings', []);
3939
}
40-
4140
if (($product = $this->initProduct()) && !empty($data)) {
4241
/** @var \Magento\Review\Model\Review $review */
4342
$review = $this->reviewFactory->create()->setData($data);
43+
$review->unsetData('review_id');
4444

4545
$validate = $review->validate();
4646
if ($validate === true) {

app/code/Magento/Review/Test/Unit/Controller/Product/PostTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function setUp()
127127
'\Magento\Review\Model\Review',
128128
[
129129
'setData', 'validate', 'setEntityId', 'getEntityIdByCode', 'setEntityPkValue', 'setStatusId',
130-
'setCustomerId', 'setStoreId', 'setStores', 'save', 'getId', 'aggregate'
130+
'setCustomerId', 'setStoreId', 'setStores', 'save', 'getId', 'aggregate', 'unsetData'
131131
],
132132
[],
133133
'',
@@ -219,7 +219,10 @@ public function setUp()
219219
*/
220220
public function testExecute()
221221
{
222-
$ratingsData = ['ratings' => [1 => 1]];
222+
$reviewData = [
223+
'ratings' => [1 => 1],
224+
'review_id' => 2
225+
];
223226
$productId = 1;
224227
$customerId = 1;
225228
$storeId = 1;
@@ -230,7 +233,7 @@ public function testExecute()
230233
->willReturn(true);
231234
$this->reviewSession->expects($this->any())->method('getFormData')
232235
->with(true)
233-
->willReturn($ratingsData);
236+
->willReturn($reviewData);
234237
$this->request->expects($this->at(0))->method('getParam')
235238
->with('category', false)
236239
->willReturn(false);
@@ -260,7 +263,7 @@ public function testExecute()
260263
->with('product', $product)
261264
->willReturnSelf();
262265
$this->review->expects($this->once())->method('setData')
263-
->with($ratingsData)
266+
->with($reviewData)
264267
->willReturnSelf();
265268
$this->review->expects($this->once())->method('validate')
266269
->willReturn(true);
@@ -270,6 +273,7 @@ public function testExecute()
270273
$this->review->expects($this->once())->method('setEntityId')
271274
->with(1)
272275
->willReturnSelf();
276+
$this->review->expects($this->once())->method('unsetData')->with('review_id');
273277
$product->expects($this->exactly(2))
274278
->method('getId')
275279
->willReturn($productId);

0 commit comments

Comments
 (0)