1<?php 2 3require_once(__DIR__ . '/../webcomponent.php'); 4 5/** 6 * Test the component plugin 7 * 8 * @group plugin_webcomponent 9 * @group plugins 10 */ 11class plugin_webcomponent_cite_test extends DokuWikiTest 12{ 13 14 protected $pluginsEnabled = [webcomponent::PLUGIN_NAME]; 15 16 17 public function test_element_name() 18 { 19 20 $elementName = syntax_plugin_webcomponent_cite::getTag(); 21 22 $this->assertEquals('cite', $elementName); 23 24 } 25 26 public function test_base() 27 { 28 29 // https://getbootstrap.com/docs/4.3/components/card/#using-custom-css 30 $element = syntax_plugin_webcomponent_cite::getTag(); 31 $doku_text = '<' . $element . '>[[:namespace:page#section|bla]]</' . $element . '>'; 32 $expected = '<cite><a href="/./doku.php?id=namespace:page#section" class="wikilink2" title="namespace:page" rel="nofollow">bla</a></cite>'; 33 $instructions = p_get_instructions($doku_text); 34 $xhtml = p_render('xhtml', $instructions, $info); 35 $this->assertEquals($expected, $xhtml); 36 37 } 38 39 40 41} 42