@@ -32,6 +32,13 @@ public function setUp(): void
32
32
$ assignments = mock \Assignments::getInstance ();
33
33
$ assignments ->clear (true );
34
34
35
+ // different values for each entry
36
+ $ second = [
37
+ ['green ' , 'red ' ],
38
+ ['green ' , 'blue ' ],
39
+ ['blue ' , 'yellow ' ]
40
+ ];
41
+
35
42
for ($ i = 0 ; $ i < 3 ; $ i ++) {
36
43
// assign a schema
37
44
$ assignments ->assignPageSchema ("test $ i " , 'schema1 ' );
@@ -42,7 +49,7 @@ public function setUp(): void
42
49
// save serial data
43
50
$ data = [
44
51
'first ' => "foo $ i " ,
45
- 'second ' => [ " bar $ i " , " baz $ i " ],
52
+ 'second ' => $ second [ $ i ],
46
53
'third ' => "foobar $ i " ,
47
54
'fourth ' => "barfoo $ i " ,
48
55
];
@@ -86,6 +93,22 @@ public function test_filter_text()
86
93
$ this ->assertCount (0 , $ result );
87
94
}
88
95
96
+ /** @noinspection PhpUnreachableStatementInspection */
97
+ public function test_filter_multi ()
98
+ {
99
+ $ schema = 'schema1 ' ;
100
+ $ result = $ this ->fetchPagesResult ($ schema , '' );
101
+ $ this ->assertCount (3 , $ result );
102
+
103
+ $ result = $ this ->fetchPagesResult ($ schema , '' , ['second ' , '= ' , 'green ' , 'AND ' ]);
104
+ $ this ->assertCount (2 , $ result );
105
+
106
+ $ this ->markTestIncomplete ('negative filters currently do not work on multi fields. See #512 ' );
107
+
108
+ $ result = $ this ->fetchPagesResult ($ schema , '' , ['second ' , '!~ ' , 'green ' , 'AND ' ]);
109
+ $ this ->assertCount (1 , $ result );
110
+ }
111
+
89
112
/**
90
113
* Test filtering on a page field, with 'usetitles' set to true and false
91
114
*/
0 commit comments