Skip to content

Commit 44ed899

Browse files
author
silinmykola
committed
33589 fix integration test
1 parent dd0124b commit 44ed899

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

app/code/Magento/CatalogSearch/Model/Advanced.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function addFilters($values)
212212
if ($attribute->getAttributeCode() == 'price') {
213213
foreach ($value as $key => $element) {
214214
if (is_array($element)) {
215-
$value[$key] = null;
215+
$value[$key] = 0;
216216
}
217217
}
218218

@@ -374,7 +374,7 @@ protected function getPreparedSearchCriteria($attribute, $value)
374374
if (is_array($value)) {
375375
foreach ($value as $key => $element) {
376376
if (is_array($element)) {
377-
$value[$key] = null;
377+
$value[$key] = '';
378378
}
379379
}
380380
if (isset($value['from']) && isset($value['to'])) {

app/code/Magento/CatalogSearch/view/frontend/templates/result.phtml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
/** This changes need to valid applying filters and configuration before search process is started. */
7+
use Magento\CatalogSearch\Block\Result;
8+
9+
/** These changes need to valid applying filters and configuration before search process is started. */
10+
11+
/** @var $block Result*/
812
$productList = $block->getProductListHtml();
913
?>
1014
<?php if ($block->getResultCount()) : ?>

dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced/ResultTest.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ public function testExecuteWithUnderscore(): void
140140
* @magentoAppArea frontend
141141
* @magentoDataFixture Magento/CatalogSearch/_files/product_for_search.php
142142
* @magentoDataFixture Magento/CatalogSearch/_files/full_reindex.php
143-
* @dataProvider searchParamsWithArrayDataProvider
143+
* @dataProvider searchParamsInArrayDataProvider
144144
*
145145
* @param array $searchParams
146146
* @return void
147147
*/
148-
public function testExecuteWithArrayInParams(array $searchParams): void
148+
public function testExecuteWithArrayInParam(array $searchParams): void
149149
{
150150
$this->getRequest()->setQuery(
151151
$this->_objectManager->create(
@@ -165,14 +165,14 @@ public function testExecuteWithArrayInParams(array $searchParams): void
165165
}
166166

167167
/**
168-
* Data provider with arrays in param values
168+
* Data provider with array in params values
169169
*
170170
* @return array
171171
*/
172-
public function searchParamsWithArrayDataProvider(): array
172+
public function searchParamsInArrayDataProvider(): array
173173
{
174174
return [
175-
'search_with_empty_arrays' => [
175+
'search_with_from_param_is_array' => [
176176
[
177177
'name' => '',
178178
'sku' => '',
@@ -184,6 +184,18 @@ public function searchParamsWithArrayDataProvider(): array
184184
]
185185
]
186186
],
187+
'search_with_to_param_is_array' => [
188+
[
189+
'name' => '',
190+
'sku' => '',
191+
'description' => '',
192+
'short_description' => '',
193+
'price' => [
194+
'from' => 0,
195+
'to' => [],
196+
]
197+
]
198+
],
187199
'search_with_params_in_array' => [
188200
[
189201
'name' => '',

0 commit comments

Comments
 (0)