Skip to content

Commit dd0124b

Browse files
author
silinmykola
committed
33589 change test data
1 parent e5df80f commit dd0124b

File tree

2 files changed

+9
-13
lines changed
  • app/code/Magento/CatalogSearch/Model
  • dev/tests/integration/testsuite/Magento/CatalogSearch/Controller/Advanced

2 files changed

+9
-13
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,18 +372,16 @@ protected function getPreparedSearchCriteria($attribute, $value)
372372
$from = null;
373373
$to = null;
374374
if (is_array($value)) {
375+
foreach ($value as $key => $element) {
376+
if (is_array($element)) {
377+
$value[$key] = null;
378+
}
379+
}
375380
if (isset($value['from']) && isset($value['to'])) {
376381
if (!empty($value['from']) || !empty($value['to'])) {
377382
$from = '';
378383
$to = '';
379384

380-
foreach ($value as $key => $element) {
381-
if (is_array($element)) {
382-
$value[$key] = null;
383-
}
384-
}
385-
386-
387385
if (isset($value['currency'])) {
388386
/** @var $currencyModel Currency */
389387
$currencyModel = $this->_currencyFactory->create()->load($value['currency']);

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public function testExecuteWithArrayInParams(array $searchParams): void
159159
$this->assertEquals(200, $this->getResponse()->getStatusCode());
160160
$responseBody = $this->getResponse()->getBody();
161161
$this->assertStringContainsString(
162-
'We can\'t find any items matching these search criteria',
162+
'We can't find any items matching these search criteria.',
163163
$responseBody
164164
);
165165
}
@@ -179,9 +179,7 @@ public function searchParamsWithArrayDataProvider(): array
179179
'description' => '',
180180
'short_description' => '',
181181
'price' => [
182-
'from' => [
183-
1
184-
],
182+
'from' => [],
185183
'to' => 1,
186184
]
187185
]
@@ -205,8 +203,8 @@ public function searchParamsWithArrayDataProvider(): array
205203
'description' => '',
206204
'short_description' => '',
207205
'price' => [
208-
['from' => ['0' => 1]],
209-
['to' => 1],
206+
'from' => ['0' => ['0' => 1]],
207+
'to' => 1,
210208
]
211209
]
212210
]

0 commit comments

Comments
 (0)