Skip to content

Commit de7aa9a

Browse files
committed
Tests: update for current code and expose invisible tests to group based
testing
1 parent 6335bc4 commit de7aa9a

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

_test/AggregationFilterTest.php

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
namespace dokuwiki\plugin\struct\test;
44

5-
5+
/**
6+
* Testing aggregation filter
7+
*
8+
* @group plugin_struct
9+
* @group plugins
10+
*/
611
class 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
}

_test/SearchConfigParameterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)