Skip to content

Commit e642288

Browse files
Merge #704
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]>
2 parents c5b229c + 43b0f45 commit e642288

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/Endpoints/SearchTestNestedFields.php renamed to tests/Endpoints/SearchNestedFieldsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Meilisearch\Endpoints\Indexes;
88
use Tests\TestCase;
99

10-
final class SearchTestNestedFields extends TestCase
10+
final class SearchNestedFieldsTest extends TestCase
1111
{
1212
private Indexes $index;
1313

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

2222
public function testBasicSearchOnNestedFields(): void
@@ -48,7 +48,7 @@ public function testSearchOnNestedFieldWithMultiplesResultsOnNestedFields(): voi
4848

4949
self::assertArrayHasKey('hits', $response);
5050
self::assertSame(6, $response['estimatedTotalHits']);
51-
self::assertSame(4, $response['hits'][0]['id']);
51+
self::assertSame(1, $response['hits'][0]['id']);
5252
}
5353

5454
public function testSearchOnNestedFieldWithOptions(): void
@@ -62,13 +62,13 @@ public function testSearchOnNestedFieldWithOptions(): void
6262
]);
6363

6464
self::assertCount(1, $response['hits']);
65-
self::assertSame(4, $response['hits'][0]['id']);
65+
self::assertSame(1, $response['hits'][0]['id']);
6666
}
6767

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

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

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

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

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

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

0 commit comments

Comments
 (0)