Skip to content

Commit 451e2c3

Browse files
committed
helper test
1 parent 18bc9ff commit 451e2c3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Test/Helper/WikiHelperTest.php

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 WikiModelTest 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+
'children'=> array()
30+
)
31+
);
32+
33+
$project = array(
34+
'id'=> '1',
35+
);
36+
37+
$htmlResult = $helper->renderChildren($children, 1, $project, false);
38+
$this->assertContains('<ul data-parent-id="1"', $htmlResult, 'htmlResult should contain <ul data-parent-id="1"');
39+
$this->assertContains('<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"');
40+
}
41+
}

0 commit comments

Comments
 (0)