Skip to content

Commit 71769bc

Browse files
committed
add failing test for #512
1 parent 6e2eda8 commit 71769bc

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

_test/AggregationResultsTest.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ public function setUp(): void
3232
$assignments = mock\Assignments::getInstance();
3333
$assignments->clear(true);
3434

35+
// different values for each entry
36+
$second = [
37+
['green', 'red'],
38+
['green', 'blue'],
39+
['blue', 'yellow']
40+
];
41+
3542
for ($i = 0; $i < 3; $i++) {
3643
// assign a schema
3744
$assignments->assignPageSchema("test$i", 'schema1');
@@ -42,7 +49,7 @@ public function setUp(): void
4249
// save serial data
4350
$data = [
4451
'first' => "foo$i",
45-
'second' => ["bar$i", "baz$i"],
52+
'second' => $second[$i],
4653
'third' => "foobar$i",
4754
'fourth' => "barfoo$i",
4855
];
@@ -86,6 +93,22 @@ public function test_filter_text()
8693
$this->assertCount(0, $result);
8794
}
8895

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+
89112
/**
90113
* Test filtering on a page field, with 'usetitles' set to true and false
91114
*/

0 commit comments

Comments
 (0)