Skip to content

Commit 6b80237

Browse files
authored
Merge pull request #82 from funktechno/f/tests
helper test
2 parents 18bc9ff + fe048e6 commit 6b80237

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Test/Helper/WikiHelperTest.php

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
require_once 'tests/units/Base.php';
4+
5+
use Kanboard\Core\Plugin\Loader;
6+
use Kanboard\Plugin\Wiki\Helper\WikiHelper;
7+
8+
class WikiHelperTest extends Base
9+
{
10+
/**
11+
* @var Plugin
12+
*/
13+
protected $plugin;
14+
15+
protected function setUp(): void
16+
{
17+
parent::setUp();
18+
19+
$plugin = new Loader($this->container);
20+
$plugin->scan();
21+
}
22+
23+
public function testRenderChildren(){
24+
$helper = new WikiHelper($this->container);
25+
$children = array(
26+
0=> array(
27+
'id'=> '5',
28+
'title'=> 'Page 1a',
29+
'ordercolumn' => '0',
30+
'children'=> array()
31+
)
32+
);
33+
34+
$project = array(
35+
'id'=> '1',
36+
);
37+
38+
$htmlResult = $helper->renderChildren($children, 1, $project, false);
39+
$this->assertStringContainsString('<ul data-parent-id="1"', $htmlResult, 'htmlResult should contain <ul data-parent-id="1"');
40+
$this->assertStringContainsString('<li class="wikipage" data-project-id="1" data-page-id="5"', $htmlResult, 'htmlResult should contain <li class="wikipage" data-project-id="1" data-page-id="5"');
41+
}
42+
}

0 commit comments

Comments
 (0)