lib = TikiLib::lib('comments'); } public function testGetHref(): void { $this->assertEquals('tiki-index.php?page=HomePage&threadId=9&comzone=show#threadId9', $this->lib->getHref('wiki page', 'HomePage', 9)); $this->assertEquals('tiki-view_blog_post.php?postId=1&threadId=10&comzone=show#threadId10', $this->lib->getHref('blog post', 1, 10)); } public function testGetRootPath(): void { $comments = $this->lib->table('tiki_comments'); $parentId = $comments->insert([ 'objectType' => 'trackeritem', 'object' => 1, 'parentId' => 0 ]); $childId = $comments->insert([ 'objectType' => 'trackeritem', 'object' => 1, 'parentId' => $parentId ]); $this->assertEquals([], $this->lib->get_root_path($parentId)); $this->assertEquals([$parentId], $this->lib->get_root_path($childId)); $comments->delete(['threadId' => $childId]); $comments->delete(['threadId' => $parentId]); } }