Skip to content

Commit 75d817a

Browse files
committed
Unsort the documents in the sort by test before indexing them
1 parent dafa1c3 commit 75d817a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/RediSearch/Query/BuilderTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function testSearchWithSortBy()
170170
$expectedResult1 = [
171171
'title' => 'Cheapest book ever.',
172172
'author' => 'Jane',
173-
'price' => 0.01,
173+
'price' => 99.01,
174174
'stock' => 55,
175175
'location' => new GeoLocation(10.9190500, 52.0504100),
176176
];
@@ -196,7 +196,8 @@ public function testSearchWithSortBy()
196196
->sortBy('price')
197197
->search('book');
198198

199-
$this->assertEquals($expectedResult1['title'], $result->getDocuments()[0]->title);
200-
$this->assertEquals($expectedResult2['title'], $result->getDocuments()[1]->title);
199+
$this->assertEquals($expectedResult1['title'], $result->getDocuments()[1]->title);
200+
$this->assertEquals($expectedResult2['title'], $result->getDocuments()[0]->title);
201+
$this->assertEquals($expectedResult3['title'], $result->getDocuments()[2]->title);
201202
}
202203
}

0 commit comments

Comments
 (0)