From ebdfc0385552c37d59889f8b9b13f7777d852500 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 26 Mar 2007 20:55:33 +0200 Subject: some test cleanups darcs-hash:20070326185533-7ad00-487a00e955386bdccd145928c7d69178327ded69.gz --- _test/cases/inc/html_hilight.test.php | 210 ++++++++++++++-------------- _test/cases/inc/parser/xhtml_links.test.php | 2 +- 2 files changed, 107 insertions(+), 105 deletions(-) (limited to '_test') diff --git a/_test/cases/inc/html_hilight.test.php b/_test/cases/inc/html_hilight.test.php index 944c90f1e..634ef2585 100644 --- a/_test/cases/inc/html_hilight.test.php +++ b/_test/cases/inc/html_hilight.test.php @@ -1,104 +1,106 @@ -assertPattern( - '/Foo bar<\/span> Foo/', - html_hilight($html,'bar') - ); - } - - function testHighlightTwoWords() { - $html = 'Foo bar Foo php Foo'; - $this->assertPattern( - '/Foo bar<\/span> Foo php<\/span> Foo/', - html_hilight($html,'bar php') - ); - } - - function testHighlightTwoWordsHtml() { - $html = 'Foo bar Foo php Foo'; - $this->assertPattern( - '/Foo bar<\/span><\/b> Foo<\/i> php<\/span> Foo/', - html_hilight($html,'bar php') - ); - } - - function testNoHighlight() { - $html = 'Foo bar Foo'; - $this->assertPattern( - '/Foo bar Foo/', - html_hilight($html,'php') - ); - } - - function testHighlightPHP() { - $html = 'Foo $_GET[\'bar\'] Foo'; - $this->assertEqual( - 'Foo $_GET[\'bar\'] Foo', - html_hilight($html,'$_GET[\'bar\']') - ); - } - - function testMatchAttribute() { - $html = 'Foo bar Foo'; - $this->assertPattern( - '/Foo bar<\/b> Foo/', - html_hilight($html,'class="x"') - ); - } - - function testMatchAttributeWord() { - $html = 'Foo bar Foo'; - $this->assertEqual( - 'Foo bar Foo', - html_hilight($html,'class="x">bar') - ); - } - - function testRegexInjection() { - $html = 'Foo bar Foo'; - $this->assertPattern( - '/Foo bar Foo/', - html_hilight($html,'*') - ); - } - - function testRegexInjectionSlash() { - $html = 'Foo bar Foo'; - $this->assertPattern( - '/Foo bar Foo/', - html_hilight($html,'x/') - ); - } - -} - +assertPattern( + '/Foo bar<\/span> Foo/', + html_hilight($html,'bar') + ); + } + + function testHighlightTwoWords() { + $html = 'Foo bar Foo php Foo'; + $this->assertPattern( + '/Foo bar<\/span> Foo php<\/span> Foo/', + html_hilight($html,'bar php') + ); + } + + function testHighlightTwoWordsHtml() { + $html = 'Foo bar Foo php Foo'; + $this->assertPattern( + '/Foo bar<\/span><\/b> Foo<\/i> php<\/span> Foo/', + html_hilight($html,'bar php') + ); + } + + function testNoHighlight() { + $html = 'Foo bar Foo'; + $this->assertPattern( + '/Foo bar Foo/', + html_hilight($html,'php') + ); + } + + function testHighlightPHP() { + $html = 'Foo $_GET[\'bar\'] Foo'; + $this->assertEqual( + 'Foo $_GET[\'bar\'] Foo', + html_hilight($html,'$_GET[\'bar\']') + ); + } + + function testMatchAttribute() { + $html = 'Foo bar Foo'; + $this->assertPattern( + '/Foo bar<\/b> Foo/', + html_hilight($html,'class="x"') + ); + } + + function testMatchAttributeWord() { + $html = 'Foo bar Foo'; + $this->assertEqual( + 'Foo bar Foo', + html_hilight($html,'class="x">bar') + ); + } + + function testRegexInjection() { + $html = 'Foo bar Foo'; + $this->assertPattern( + '/Foo bar Foo/', + html_hilight($html,'*') + ); + } + + function testRegexInjectionSlash() { + $html = 'Foo bar Foo'; + $this->assertPattern( + '/Foo bar Foo/', + html_hilight($html,'x/') + ); + } + +} + diff --git a/_test/cases/inc/parser/xhtml_links.test.php b/_test/cases/inc/parser/xhtml_links.test.php index 42ffb020e..6a74445b0 100644 --- a/_test/cases/inc/parser/xhtml_links.test.php +++ b/_test/cases/inc/parser/xhtml_links.test.php @@ -12,7 +12,7 @@ class xhtml_links_test extends UnitTestCase { $p = new Doku_Renderer_xhtml(); $p->emaillink('foo@example.com',''); - $expect = '<script>alert(\'"alert"\');</script>'; + $expect = '<script>alert('"alert"');</script>'; $this->assertEqual($p->doc,$expect); } -- cgit v1.2.3