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 8
8
class FilterBuilder extends Builder
9
9
{
10
10
/**
11
+ * The condition array.
11
12
* @var array
12
13
*/
13
14
public $ wheres = [
14
15
'must ' => [],
15
- 'must_not ' => []
16
+ 'must_not ' => [],
16
17
];
17
18
18
19
/**
20
+ * The with array.
21
+ *
19
22
* @var array|string
20
23
*/
21
24
public $ with ;
22
25
23
26
/**
27
+ * The offset
28
+ *
24
29
* @var int
25
30
*/
26
31
public $ offset ;
27
32
28
33
/**
34
+ * The collapse parameter.
35
+ *
29
36
* @var string
30
37
*/
31
38
public $ collapse ;
Original file line number Diff line number Diff line change @@ -15,26 +15,21 @@ public function testRule()
15
15
{
16
16
$ builder = new SearchBuilder ($ this ->mockModel (), 'qwerty ' );
17
17
18
- $ ruleFunc = function (SearchBuilder $ builder ) {
18
+ $ ruleFunc = function (SearchBuilder $ builder ) {
19
19
return [
20
20
'must ' => [
21
21
'match ' => [
22
- 'foo ' => $ builder ->query
23
- ]
24
- ]
22
+ 'foo ' => $ builder ->query ,
23
+ ],
24
+ ],
25
25
];
26
26
};
27
27
28
- $ builder
29
- ->rule (SearchRule::class)
30
- ->rule ($ ruleFunc );
28
+ $ builder ->rule (SearchRule::class)->rule ($ ruleFunc );
31
29
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 );
39
34
}
40
- }
35
+ }
Original file line number Diff line number Diff line change @@ -14,36 +14,27 @@ public function mockIndexConfigurator(array $params = [])
14
14
{
15
15
$ name = $ params ['name ' ] ?? 'test ' ;
16
16
17
- $ methods = array_merge (
18
- $ params ['methods ' ] ?? [],
19
- [
17
+ $ methods = array_merge ($ params ['methods ' ] ?? [], [
20
18
'getName ' ,
21
19
'getSettings ' ,
22
20
'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 ' );
47
38
48
39
return $ mock ;
49
40
}
You can’t perform that action at this time.
0 commit comments