Skip to content

Commit be95306

Browse files
Spamerczclaude
andcommitted
fix(tests): update tests for new constructor and Nested toArray changes
- Add missing $postFilter argument in ElasticQuery and AggregationCollection tests - Update Nested test assertions to match new query array wrapping Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4401ccf commit be95306

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

tests/SpameriTests/ElasticQuery/Aggregation/AggregationCollection.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class AggregationCollection extends \Tester\TestCase
149149
null,
150150
null,
151151
null,
152+
null,
152153
$collection,
153154
);
154155

tests/SpameriTests/ElasticQuery/ElasticQuery.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class ElasticQuery extends \Tester\TestCase
7979
$term
8080
)
8181
),
82+
NULL,
8283
new \Spameri\ElasticQuery\Options\SortCollection(
8384
new \Spameri\ElasticQuery\Options\Sort(
8485
'year',

tests/SpameriTests/ElasticQuery/Query/Nested.phpt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Nested extends \Tester\TestCase
3131

3232
\Tester\Assert::true(isset($array['nested']));
3333
\Tester\Assert::same('comments', $array['nested']['path']);
34-
\Tester\Assert::true(isset($array['nested']['query']['bool']));
34+
\Tester\Assert::true(isset($array['nested']['query'][0]['bool']));
3535
}
3636

3737

@@ -47,8 +47,8 @@ class Nested extends \Tester\TestCase
4747
$array = $nested->toArray();
4848

4949
\Tester\Assert::same('comments', $array['nested']['path']);
50-
\Tester\Assert::true(isset($array['nested']['query']['bool']['bool']['must']));
51-
\Tester\Assert::count(1, $array['nested']['query']['bool']['bool']['must']);
50+
\Tester\Assert::true(isset($array['nested']['query'][0]['bool']['must']));
51+
\Tester\Assert::count(1, $array['nested']['query'][0]['bool']['must']);
5252
}
5353

5454

@@ -74,8 +74,8 @@ class Nested extends \Tester\TestCase
7474

7575
$array = $nested->toArray();
7676

77-
\Tester\Assert::true(isset($array['nested']['query']['bool']['bool']['must']));
78-
\Tester\Assert::true(isset($array['nested']['query']['bool']['bool']['should']));
77+
\Tester\Assert::true(isset($array['nested']['query'][0]['bool']['must']));
78+
\Tester\Assert::true(isset($array['nested']['query'][0]['bool']['should']));
7979
}
8080

8181

0 commit comments

Comments
 (0)