File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace dokuwiki \plugin \struct \test ;
4
4
5
-
5
+ /**
6
+ * Testing aggregation filter
7
+ *
8
+ * @group plugin_struct
9
+ * @group plugins
10
+ */
6
11
class AggregationFilterTest extends StructTest
7
12
{
8
13
protected $ items = [
@@ -38,7 +43,7 @@ public function testGetAllColumnValues()
38
43
'red ' => 'red ' ,
39
44
'yellow ' => 'yellow '
40
45
],
41
- $ values [0 ]['values ' ]
46
+ $ this -> trimKeys ( $ values [0 ]['values ' ])
42
47
);
43
48
44
49
$ this ->assertEquals (
@@ -51,12 +56,23 @@ public function testGetAllColumnValues()
51
56
'car ' => 'car ' ,
52
57
'laptop ' => 'laptop '
53
58
],
54
- $ values [1 ]['values ' ]
59
+ $ this -> trimKeys ( $ values [1 ]['values ' ])
55
60
);
56
61
57
62
$ this ->assertEquals (
58
63
'Label 2 ' ,
59
64
$ values [1 ]['label ' ]
60
65
);
61
66
}
67
+
68
+ /**
69
+ * Reverses key padding workaround in AggregationFilter::getAllColumnValues()
70
+ *
71
+ * @param array $values
72
+ * @return int[]|string[]
73
+ */
74
+ protected function trimKeys ($ values )
75
+ {
76
+ return array_flip (array_map (static fn ($ val ) => trim ($ val ), array_flip ($ values )));
77
+ }
62
78
}
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ public function test_pagination()
260
260
$ this ->assertEquals ($ this ->fixedrev , $ tr1 ->attr ('data-rev ' ));
261
261
262
262
$ tr6aPrev = $ table ->find (".row6 a.prev " );
263
- $ this ->assertEquals (' /./doku.php ?id=test_pagination ' , $ tr6aPrev ->attr ('href ' ));
263
+ $ this ->assertEquals (DOKU_BASE . DOKU_SCRIPT . ' ?id=test_pagination ' , $ tr6aPrev ->attr ('href ' ));
264
264
265
265
}
266
266
}
You can’t perform that action at this time.
0 commit comments