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 22
33namespace dokuwiki \plugin \struct \test ;
44
5-
5+ /**
6+ * Testing aggregation filter
7+ *
8+ * @group plugin_struct
9+ * @group plugins
10+ */
611class AggregationFilterTest extends StructTest
712{
813 protected $ items = [
@@ -38,7 +43,7 @@ public function testGetAllColumnValues()
3843 'red ' => 'red ' ,
3944 'yellow ' => 'yellow '
4045 ],
41- $ values [0 ]['values ' ]
46+ $ this -> trimKeys ( $ values [0 ]['values ' ])
4247 );
4348
4449 $ this ->assertEquals (
@@ -51,12 +56,23 @@ public function testGetAllColumnValues()
5156 'car ' => 'car ' ,
5257 'laptop ' => 'laptop '
5358 ],
54- $ values [1 ]['values ' ]
59+ $ this -> trimKeys ( $ values [1 ]['values ' ])
5560 );
5661
5762 $ this ->assertEquals (
5863 'Label 2 ' ,
5964 $ values [1 ]['label ' ]
6065 );
6166 }
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+ }
6278}
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ public function test_pagination()
260260 $ this ->assertEquals ($ this ->fixedrev , $ tr1 ->attr ('data-rev ' ));
261261
262262 $ 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 ' ));
264264
265265 }
266266}
You can’t perform that action at this time.
0 commit comments