Skip to content

Commit 20da669

Browse files
committed
MC-33026: Upgrade magento with MySQL search engine removed
- fix build errors
1 parent 2aece21 commit 20da669

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

app/code/Magento/Elasticsearch/Test/Unit/Setup/ValidatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function testValidateFail()
7373
$this->elasticsearchClientMock->expects($this->once())->method('testConnection')->willReturn(false);
7474

7575
$expected = ['Elasticsearch connection validation failed'];
76-
$this->assertEquals($expected, $this->validator->validate(['engine' => $searchEngine]));
76+
$this->assertEquals($expected, $this->validator->validate(['search-engine' => $searchEngine]));
7777
}
7878

7979
public function testValidateFailException()

app/code/Magento/Search/Test/Unit/Model/SearchEngine/ValidatorTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function setUp()
3333
Validator::class,
3434
[
3535
'scopeConfig' => $this->scopeConfigMock,
36-
'engineValidators' => ['other-engine' => $this->otherEngineValidatorMock],
36+
'engineValidators' => ['otherEngine' => $this->otherEngineValidatorMock],
3737
'engineBlacklist' => ['badEngine']
3838
]
3939
);
@@ -47,7 +47,7 @@ public function testValidateValid()
4747
->expects($this->once())
4848
->method('getValue')
4949
->with('catalog/search/engine')
50-
->willReturn('other-engine');
50+
->willReturn('otherEngine');
5151

5252
$this->otherEngineValidatorMock->expects($this->once())->method('validate')->willReturn([]);
5353

@@ -58,18 +58,18 @@ public function testValidateBlacklist()
5858
{
5959
$expectedErrors = ["Search engine 'badEngine' is not supported. Fix search configuration and try again."];
6060

61-
$this->assertEquals($expectedErrors, $this->validator->validate(['engine' => 'badEngine']));
61+
$this->assertEquals($expectedErrors, $this->validator->validate(['search-engine' => 'badEngine']));
6262
}
6363

6464
public function testValidateInvalid()
6565
{
66-
$expectedErrors = ['Validation failed for other-engine'];
66+
$expectedErrors = ['Validation failed for otherEngine'];
6767

6868
$this->otherEngineValidatorMock
6969
->expects($this->once())
7070
->method('validate')
7171
->willReturn($expectedErrors);
7272

73-
$this->assertEquals($expectedErrors, $this->validator->validate(['engine' => 'other-engine']));
73+
$this->assertEquals($expectedErrors, $this->validator->validate(['search-engine' => 'otherEngine']));
7474
}
7575
}

setup/src/Magento/Setup/Console/Command/UpgradeCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
138138
$arrayInput->setInteractive($input->isInteractive());
139139
$result = $importConfigCommand->run($arrayInput, $output);
140140
if ($result === \Magento\Framework\Console\Cli::RETURN_FAILURE) {
141-
throw new \Magento\Framework\Exception\RuntimeException(__('%1 failed. See previous output.', ConfigImportCommand::COMMAND_NAME));
141+
throw new \Magento\Framework\Exception\RuntimeException(
142+
__('%1 failed. See previous output.', ConfigImportCommand::COMMAND_NAME)
143+
);
142144
}
143145
}
144146

setup/src/Magento/Setup/Controller/SearchEngineCheck.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public function indexAction(): JsonModel
7070
/**
7171
* Check search engine parameter is valid
7272
*
73-
* @param $requestParams
73+
* @param array $requestParams
7474
* @return bool
7575
* @throws InputException
7676
*/
77-
private function isValidSearchEngine($requestParams): bool
77+
private function isValidSearchEngine(array $requestParams): bool
7878
{
7979
$selectedEngine = $requestParams['engine'] ?? null;
8080
$availableSearchEngines = $this->searchConfigOptionsList->getAvailableSearchEngineList();

setup/src/Magento/Setup/Test/Unit/Model/SearchConfigTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ protected function setUp()
6666
public function testSaveConfiguration(array $installInput, array $searchInput)
6767
{
6868
$this->installConfigMock->expects($this->once())->method('configure')->with($searchInput);
69-
$this->searchEngineValidatorMock->expects($this->once())->method('validate')->with($searchInput)->willReturn([]);
69+
$this->searchEngineValidatorMock
70+
->expects($this->once())
71+
->method('validate')
72+
->with($searchInput)
73+
->willReturn([]);
7074

7175
$this->searchConfig->saveConfiguration($installInput);
7276
}

0 commit comments

Comments
 (0)