Skip to content

Commit

Permalink
Merge #704
Browse files Browse the repository at this point in the history
704: Fixed SearchNestedFieldsTest test r=norkunas a=aivchen

# Pull Request

## What does this PR do?
- The old name of the test is `SearchTestNestedFields` so phpunit ignored it as this test didn't have `*Test` suffix
- After fixing the name the test failed so I fixed the test:)


Co-authored-by: Andrei Ivchenkov <[email protected]>
  • Loading branch information
meili-bors[bot] and Andrei Ivchenkov authored Dec 11, 2024
2 parents c5b229c + 43b0f45 commit e642288
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Meilisearch\Endpoints\Indexes;
use Tests\TestCase;

final class SearchTestNestedFields extends TestCase
final class SearchNestedFieldsTest extends TestCase
{
private Indexes $index;

Expand All @@ -16,7 +16,7 @@ protected function setUp(): void
parent::setUp();
$this->index = $this->createEmptyIndex($this->safeIndexName('nestedIndex'));
$promise = $this->index->updateDocuments(self::NESTED_DOCUMENTS);
$this->index->waitForTask($promise['uid']);
$this->index->waitForTask($promise['taskUid']);
}

public function testBasicSearchOnNestedFields(): void
Expand Down Expand Up @@ -48,7 +48,7 @@ public function testSearchOnNestedFieldWithMultiplesResultsOnNestedFields(): voi

self::assertArrayHasKey('hits', $response);
self::assertSame(6, $response['estimatedTotalHits']);
self::assertSame(4, $response['hits'][0]['id']);
self::assertSame(1, $response['hits'][0]['id']);
}

public function testSearchOnNestedFieldWithOptions(): void
Expand All @@ -62,13 +62,13 @@ public function testSearchOnNestedFieldWithOptions(): void
]);

self::assertCount(1, $response['hits']);
self::assertSame(4, $response['hits'][0]['id']);
self::assertSame(1, $response['hits'][0]['id']);
}

public function testSearchOnNestedFieldWithSearchableAtributes(): void
{
$response = $this->index->updateSearchableAttributes(['title', 'info.comment']);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand All @@ -87,7 +87,7 @@ public function testSearchOnNestedFieldWithSearchableAtributes(): void
public function testSearchOnNestedFieldWithSortableAtributes(): void
{
$response = $this->index->updateSortableAttributes(['info.reviewNb']);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand All @@ -111,7 +111,7 @@ public function testSearchOnNestedFieldWithSortableAtributesAndSearchableAttribu
'searchableAttributes' => ['title', 'info.comment'],
'sortableAttributes' => ['info.reviewNb'],
]);
$this->index->waitForTask($response['uid']);
$this->index->waitForTask($response['taskUid']);

$response = $this->index->search('An awesome');

Expand Down

0 comments on commit e642288

Please sign in to comment.