This repository was archived by the owner on Nov 4, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +36
-43
lines changed Expand file tree Collapse file tree 3 files changed +36
-43
lines changed Original file line number Diff line number Diff line change 88class FilterBuilder extends Builder
99{
1010 /**
11+ * The condition array.
1112 * @var array
1213 */
1314 public $ wheres = [
1415 'must ' => [],
15- 'must_not ' => []
16+ 'must_not ' => [],
1617 ];
1718
1819 /**
20+ * The with array.
21+ *
1922 * @var array|string
2023 */
2124 public $ with ;
2225
2326 /**
27+ * The offset
28+ *
2429 * @var int
2530 */
2631 public $ offset ;
2732
2833 /**
34+ * The collapse parameter.
35+ *
2936 * @var string
3037 */
3138 public $ collapse ;
Original file line number Diff line number Diff line change @@ -15,26 +15,21 @@ public function testRule()
1515 {
1616 $ builder = new SearchBuilder ($ this ->mockModel (), 'qwerty ' );
1717
18- $ ruleFunc = function (SearchBuilder $ builder ) {
18+ $ ruleFunc = function (SearchBuilder $ builder ) {
1919 return [
2020 'must ' => [
2121 'match ' => [
22- 'foo ' => $ builder ->query
23- ]
24- ]
22+ 'foo ' => $ builder ->query ,
23+ ],
24+ ],
2525 ];
2626 };
2727
28- $ builder
29- ->rule (SearchRule::class)
30- ->rule ($ ruleFunc );
28+ $ builder ->rule (SearchRule::class)->rule ($ ruleFunc );
3129
32- $ this ->assertEquals (
33- [
34- SearchRule::class,
35- $ ruleFunc
36- ],
37- $ builder ->rules
38- );
30+ $ this ->assertEquals ([
31+ SearchRule::class,
32+ $ ruleFunc ,
33+ ], $ builder ->rules );
3934 }
40- }
35+ }
Original file line number Diff line number Diff line change @@ -14,36 +14,27 @@ public function mockIndexConfigurator(array $params = [])
1414 {
1515 $ name = $ params ['name ' ] ?? 'test ' ;
1616
17- $ methods = array_merge (
18- $ params ['methods ' ] ?? [],
19- [
17+ $ methods = array_merge ($ params ['methods ' ] ?? [], [
2018 'getName ' ,
2119 'getSettings ' ,
2220 'getDefaultMapping ' ,
23- 'getWriteAlias '
24- ]
25- );
26-
27- $ mock = $ this
28- ->getMockBuilder (ElasticIndexConfigurator::class)
29- ->setMethods ($ methods )
30- ->getMock ();
31-
32- $ mock
33- ->method ('getName ' )
34- ->willReturn ($ name );
35-
36- $ mock
37- ->method ('getSettings ' )
38- ->willReturn ($ params ['settings ' ] ?? []);
39-
40- $ mock
41- ->method ('getDefaultMapping ' )
42- ->willReturn ($ params ['default_mapping ' ] ?? []);
43-
44- $ mock
45- ->method ('getWriteAlias ' )
46- ->willReturn ($ name . '_write ' );
21+ 'getWriteAlias ' ,
22+ ]);
23+
24+ $ mock = $ this ->getMockBuilder (ElasticIndexConfigurator::class)
25+ ->setMethods ($ methods )->getMock ();
26+
27+ $ mock ->method ('getName ' )
28+ ->willReturn ($ name );
29+
30+ $ mock ->method ('getSettings ' )
31+ ->willReturn ($ params ['settings ' ] ?? []);
32+
33+ $ mock ->method ('getDefaultMapping ' )
34+ ->willReturn ($ params ['default_mapping ' ] ?? []);
35+
36+ $ mock ->method ('getWriteAlias ' )
37+ ->willReturn ($ name .'_write ' );
4738
4839 return $ mock ;
4940 }
You can’t perform that action at this time.
0 commit comments