mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-39915 cleanup core_markdown_testcase
This commit is contained in:
parent
aa2432331c
commit
ce14faf87e
@ -15,7 +15,7 @@
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Test markdown text format
|
||||
* Test markdown text format.
|
||||
*
|
||||
* @package core
|
||||
* @category phpunit
|
||||
@ -43,24 +43,24 @@ class core_markdown_testcase extends basic_testcase {
|
||||
public function test_paragraphs() {
|
||||
$text = "one\n\ntwo";
|
||||
$result = "<p>one</p>\n\n<p>two</p>\n";
|
||||
$this->assertEquals($result, markdown_to_html($text));
|
||||
$this->assertSame($result, markdown_to_html($text));
|
||||
}
|
||||
|
||||
public function test_headings() {
|
||||
$text = "Header 1\n====================\n\n## Header 2";
|
||||
$result = "<h1>Header 1</h1>\n\n<h2>Header 2</h2>\n";
|
||||
$this->assertEquals($result, markdown_to_html($text));
|
||||
$this->assertSame($result, markdown_to_html($text));
|
||||
}
|
||||
|
||||
public function test_lists() {
|
||||
$text = "* one\n* two\n* three\n";
|
||||
$result = "<ul>\n<li>one</li>\n<li>two</li>\n<li>three</li>\n</ul>\n";
|
||||
$this->assertEquals($result, markdown_to_html($text));
|
||||
$this->assertSame($result, markdown_to_html($text));
|
||||
}
|
||||
|
||||
public function test_links() {
|
||||
$text = "some [example link](http://example.com/)";
|
||||
$result = "<p>some <a href=\"http://example.com/\">example link</a></p>\n";
|
||||
$this->assertEquals($result, markdown_to_html($text));
|
||||
$this->assertSame($result, markdown_to_html($text));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user