Skip to content

Commit f3b10b9

Browse files
committed
ACP2E-3521: [CLOUD] Issue with Products are Not Visible in Frontend After Saving in Magento Admin
1 parent 3c820a0 commit f3b10b9

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

app/code/Magento/Elasticsearch/Test/Unit/Model/Adapter/ElasticsearchTest.php

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
/**
3-
* Copyright © Magento, Inc. All rights reserved.
4-
* See COPYING.txt for license details.
3+
* Copyright 2015 Adobe
4+
* All Rights Reserved.
55
*/
66
declare(strict_types=1);
77

@@ -154,14 +154,7 @@ protected function setUp(): void
154154
$elasticsearchClientMock->expects($this->any())
155155
->method('indices')
156156
->willReturn($indicesMock);
157-
$this->client = $this->getMockBuilder(Elasticsearch::class)
158-
->setConstructorArgs(
159-
[
160-
'options' => $this->getClientOptions(),
161-
'elasticsearchClient' => $elasticsearchClientMock
162-
]
163-
)
164-
->getMock();
157+
$this->client = $this->createMock(Elasticsearch::class);
165158
$this->connectionManager->expects($this->any())
166159
->method('getConnection')
167160
->willReturn($this->client);
@@ -300,7 +293,8 @@ public function testPrepareDocsPerStore(): void
300293
public function testAddDocs(): void
301294
{
302295
$this->client->expects($this->once())
303-
->method('bulkQuery');
296+
->method('bulkQuery')
297+
->willReturn(['errors' => false]);
304298
$this->assertSame(
305299
$this->model,
306300
$this->model->addDocs(
@@ -698,24 +692,6 @@ function ($arg1, $arg2) use ($settings) {
698692
$this->emulateCleanIndex();
699693
}
700694

701-
/**
702-
* Get elasticsearch client options
703-
*
704-
* @return array
705-
*/
706-
protected function getClientOptions(): array
707-
{
708-
return [
709-
'hostname' => 'localhost',
710-
'port' => '9200',
711-
'timeout' => 15,
712-
'index' => 'magento2',
713-
'enableAuth' => 1,
714-
'username' => 'user',
715-
'password' => 'my-password'
716-
];
717-
}
718-
719695
/**
720696
* Run Clean Index; Index Name Mock value should be non-nullable for PHP 8.1 compatibility
721697
*

app/code/Magento/Elasticsearch7/Test/Unit/Model/Client/ElasticsearchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function testBulkQuery()
272272
->method('bulk')
273273
->with([])
274274
->willReturn($result);
275-
self::assertEquals($result, $this->model->bulkQuery([]));
275+
$this->assertEquals($result, $this->model->bulkQuery([]));
276276
}
277277

278278
/**

0 commit comments

Comments
 (0)