Skip to content

Commit

Permalink
Rector Rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick committed Sep 3, 2023
1 parent abe61e0 commit ed56c12
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions tests/OpenSearchEngineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function testUpdateAddsObjectsToIndex(): void
public function testUpdateWithSoftDeletes(): void
{
$client = m::mock(Client::class);
$searchableModel = new SearchableAndSoftDeletesModel([
$searchableAndSoftDeletesModel = new SearchableAndSoftDeletesModel([
'id' => 1,
]);
$client->shouldReceive('bulk')
Expand All @@ -81,31 +81,29 @@ public function testUpdateWithSoftDeletes(): void
],
[
'id' => 1,
'__soft_deleted' =>0,
$searchableModel->getScoutKeyName() => $searchableModel->getScoutKey(),
'__soft_deleted' => 0,
$searchableAndSoftDeletesModel->getScoutKeyName() => $searchableAndSoftDeletesModel->getScoutKey(),
],
],
]);

$openSearchEngine = new OpenSearchEngine($client,true);
$openSearchEngine->update(Collection::make([$searchableModel]));
$openSearchEngine = new OpenSearchEngine($client, true);
$openSearchEngine->update(Collection::make([$searchableAndSoftDeletesModel]));
}

public function testUpdateEmpty()
public function testUpdateEmpty(): void
{
$client = m::mock(Client::class);
$client->shouldNotReceive('bulk')
;
$client->shouldNotReceive('bulk');

$openSearchEngine = new OpenSearchEngine($client);
$openSearchEngine->update(Collection::make([]));
}

public function testDeleteEmpty()
public function testDeleteEmpty(): void
{
$client = m::mock(Client::class);
$client->shouldNotReceive('bulk')
;
$client->shouldNotReceive('bulk');

$openSearchEngine = new OpenSearchEngine($client);
$openSearchEngine->delete(Collection::make([]));
Expand Down Expand Up @@ -679,7 +677,7 @@ public function testMapWithoutHits(): void

$results = $openSearchEngine->map($builder, [
'nbHits' => 1,
'hits'=>null
'hits' => null,
], $model);

$this->assertCount(0, $results);
Expand All @@ -702,7 +700,7 @@ public function testLazyMapWithoutHits(): void

$results = $openSearchEngine->lazyMap($builder, [
'nbHits' => 1,
'hits'=>null
'hits' => null,
], $model);

$this->assertCount(0, $results);
Expand Down

0 comments on commit ed56c12

Please sign in to comment.