Skip to content

Commit 759b26a

Browse files
committed
#112268 tests
1 parent 54dd201 commit 759b26a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/Functional/Search/SearchQueryTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,23 @@ public function testSortBy(): void
4949
$this->assertDocumentIds([1, 150, 319]);
5050
}
5151

52+
public function testSelect(): void
53+
{
54+
$this->testing->select(['product_id'])->take(1);
55+
$result = $this->testing->get();
56+
57+
$this->assertEquals(1, $result[0]['_source']['product_id']);
58+
$this->assertArrayNotHasKey('name', $result[0]['_source']);
59+
}
60+
61+
public function testExclude(): void
62+
{
63+
$this->testing->exclude(['product_id'])->take(1);
64+
$result = $this->testing->get();
65+
66+
$this->assertArrayNotHasKey('product_id', $result[0]['_source']);
67+
}
68+
5269
public function testSortByNested(): void
5370
{
5471
$filter = function (BoolQuery $query) {

0 commit comments

Comments
 (0)