diff options
author | Andreas Gohr <andi@splitbrain.org> | 2012-05-01 22:58:57 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2012-05-01 22:58:57 +0200 |
commit | 050f8f4ddc32167e205a190eec9a60ad8f3caed5 (patch) | |
tree | d33554bde021d49cc7d802b4e053357e5e3b6b8f | |
parent | 3c0d44f1aa44d3ac3d8b9e652d172b1eda680bbf (diff) | |
download | rpg-050f8f4ddc32167e205a190eec9a60ad8f3caed5.tar.gz rpg-050f8f4ddc32167e205a190eec9a60ad8f3caed5.tar.bz2 |
removed unecessary requiresin unit tests
38 files changed, 269 insertions, 360 deletions
diff --git a/_test/tests/inc/auth_aclcheck.test.php b/_test/tests/inc/auth_aclcheck.test.php index 837926904..ea48ec6a5 100644 --- a/_test/tests/inc/auth_aclcheck.test.php +++ b/_test/tests/inc/auth_aclcheck.test.php @@ -1,9 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/auth.php'; -require_once DOKU_INC.'inc/auth/basic.class.php'; - class auth_acl_test extends DokuWikiTest { var $oldConf; diff --git a/_test/tests/inc/auth_admincheck.test.php b/_test/tests/inc/auth_admincheck.test.php index c108c60c0..d88399cbe 100644 --- a/_test/tests/inc/auth_admincheck.test.php +++ b/_test/tests/inc/auth_admincheck.test.php @@ -1,9 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/auth.php'; -require_once DOKU_INC.'inc/auth/basic.class.php'; - class auth_admin_test_AuthInSensitive extends auth_basic { function isCaseSensitive(){ return false; diff --git a/_test/tests/inc/auth_nameencode.test.php b/_test/tests/inc/auth_nameencode.test.php index a3df6ac8c..21db304e0 100644 --- a/_test/tests/inc/auth_nameencode.test.php +++ b/_test/tests/inc/auth_nameencode.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/auth.php'; - class auth_nameencode_test extends DokuWikiTest { function teardown() { diff --git a/_test/tests/inc/auth_password.test.php b/_test/tests/inc/auth_password.test.php index 515adc8f5..426353291 100644 --- a/_test/tests/inc/auth_password.test.php +++ b/_test/tests/inc/auth_password.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/auth.php'; - class auth_password_test extends PHPUnit_Framework_TestCase { // hashes for the password foo$method, using abcdefgh as salt diff --git a/_test/tests/inc/common_cleanText.test.php b/_test/tests/inc/common_cleanText.test.php index 58f38d9bf..00e70d4c7 100644 --- a/_test/tests/inc/common_cleanText.test.php +++ b/_test/tests/inc/common_cleanText.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC . 'inc/init.php'; -require_once DOKU_INC . 'inc/common.php'; - class common_cleanText_test extends DokuWikiTest { function test_unix(){ diff --git a/_test/tests/inc/common_clientip.test.php b/_test/tests/inc/common_clientip.test.php index 680050e42..5b569cd98 100644 --- a/_test/tests/inc/common_clientip.test.php +++ b/_test/tests/inc/common_clientip.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/common.php'; - class common_clientIP_test extends DokuWikiTest { function test_simple_all(){ diff --git a/_test/tests/inc/common_obfuscate.test.php b/_test/tests/inc/common_obfuscate.test.php index 19dd2ff2c..b8ec70980 100644 --- a/_test/tests/inc/common_obfuscate.test.php +++ b/_test/tests/inc/common_obfuscate.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/common.php'; - class common_obfuscate_test extends DokuWikiTest { function test_none(){ diff --git a/_test/tests/inc/common_pagetemplate.test.php b/_test/tests/inc/common_pagetemplate.test.php index c4a2dfdf9..a076ce069 100644 --- a/_test/tests/inc/common_pagetemplate.test.php +++ b/_test/tests/inc/common_pagetemplate.test.php @@ -1,8 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/common.php'; - class common_pagetemplate_test extends DokuWikiTest { function test_none(){ diff --git a/_test/tests/inc/form_form.test.php b/_test/tests/inc/form_form.test.php index f55f16106..02242a807 100644 --- a/_test/tests/inc/form_form.test.php +++ b/_test/tests/inc/form_form.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; - class form_test extends DokuWikiTest { function _testform() { diff --git a/_test/tests/inc/httpclient_https.test.php b/_test/tests/inc/httpclient_https.test.php index c51cd4904..26a0f86db 100644 --- a/_test/tests/inc/httpclient_https.test.php +++ b/_test/tests/inc/httpclient_https.test.php @@ -1,7 +1,5 @@ <?php -require_once dirname(__FILE__).'/httpclient_http.test.php'; - class httpclient_https_test extends httpclient_http_test { protected $server = 'https://httpbin.org/'; diff --git a/_test/tests/inc/init_fullpath.test.php b/_test/tests/inc/init_fullpath.test.php index e5b322874..fabf03fa0 100644 --- a/_test/tests/inc/init_fullpath.test.php +++ b/_test/tests/inc/init_fullpath.test.php @@ -1,5 +1,4 @@ <?php -require_once DOKU_INC.'inc/init.php'; class init_fullpath_test extends DokuWikiTest { diff --git a/_test/tests/inc/init_getbaseurl.test.php b/_test/tests/inc/init_getbaseurl.test.php index 9d1377b3c..af5a8b318 100644 --- a/_test/tests/inc/init_getbaseurl.test.php +++ b/_test/tests/inc/init_getbaseurl.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; - class init_getBaseURL_test extends DokuWikiTest { /** diff --git a/_test/tests/inc/ixr_library_date.test.php b/_test/tests/inc/ixr_library_date.test.php index 377b0fd33..f38486925 100644 --- a/_test/tests/inc/ixr_library_date.test.php +++ b/_test/tests/inc/ixr_library_date.test.php @@ -1,6 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; require_once DOKU_INC.'inc/IXR_Library.php'; class ixr_library_date_test extends DokuWikiTest { diff --git a/_test/tests/inc/ixr_library_ixr_message.test.php b/_test/tests/inc/ixr_library_ixr_message.test.php index ea7646b6a..b8afd607e 100644 --- a/_test/tests/inc/ixr_library_ixr_message.test.php +++ b/_test/tests/inc/ixr_library_ixr_message.test.php @@ -1,13 +1,7 @@ <?php -require_once DOKU_INC.'inc/init.php'; -require_once DOKU_INC.'inc/IXR_Library.php'; class ixr_library_ixr_message_test extends DokuWikiTest { - - - - function test_untypedvalue1(){ $xml = '<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wiki.getBackLinks</methodName><params><param><value> change </value></param></params></methodCall>'; diff --git a/_test/tests/inc/mail_isvalid.test.php b/_test/tests/inc/mail_isvalid.test.php index 58f8e69d7..25e6b1f7b 100644 --- a/_test/tests/inc/mail_isvalid.test.php +++ b/_test/tests/inc/mail_isvalid.test.php @@ -1,6 +1,4 @@ <?php -// use no mbstring help here -require_once DOKU_INC.'inc/init.php'; class mail_isvalid extends DokuWikiTest { diff --git a/_test/tests/inc/mail_quoted_printable_encode.test.php b/_test/tests/inc/mail_quoted_printable_encode.test.php index 888b1d1bf..52ddf6228 100644 --- a/_test/tests/inc/mail_quoted_printable_encode.test.php +++ b/_test/tests/inc/mail_quoted_printable_encode.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/mail.php'; - class mail_quotedprintable_encode extends DokuWikiTest { function test_simple(){ diff --git a/_test/tests/inc/pageutils_clean_id.test.php b/_test/tests/inc/pageutils_clean_id.test.php index 37debfa0a..9c5781b24 100644 --- a/_test/tests/inc/pageutils_clean_id.test.php +++ b/_test/tests/inc/pageutils_clean_id.test.php @@ -1,6 +1,4 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; -require_once DOKU_INC.'inc/pageutils.php'; class init_clean_id_test extends DokuWikiTest { diff --git a/_test/tests/inc/pageutils_getid.test.php b/_test/tests/inc/pageutils_getid.test.php index 608760298..0fcd58666 100644 --- a/_test/tests/inc/pageutils_getid.test.php +++ b/_test/tests/inc/pageutils_getid.test.php @@ -1,12 +1,10 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; -require_once DOKU_INC.'inc/pageutils.php'; class init_getID_test extends DokuWikiTest { /** * fetch media files with basedir and urlrewrite=2 - * + * * data provided by Jan Decaluwe <jan@jandecaluwe.com> */ function test1(){ diff --git a/_test/tests/inc/pageutils_resolve_id.test.php b/_test/tests/inc/pageutils_resolve_id.test.php index 91f8dc696..23a2405d4 100644 --- a/_test/tests/inc/pageutils_resolve_id.test.php +++ b/_test/tests/inc/pageutils_resolve_id.test.php @@ -1,6 +1,4 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; -require_once DOKU_INC.'inc/pageutils.php'; class init_resolve_id_test extends DokuWikiTest { diff --git a/_test/tests/inc/pageutils_resolve_pageid.test.php b/_test/tests/inc/pageutils_resolve_pageid.test.php index 32e5f841f..41a441658 100644 --- a/_test/tests/inc/pageutils_resolve_pageid.test.php +++ b/_test/tests/inc/pageutils_resolve_pageid.test.php @@ -1,9 +1,4 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; -require_once DOKU_INC.'inc/pageutils.php'; - -global $conf; -if (!isset($conf['datadir'])) $conf['datadir'] = $conf['savedir'].'/pages'; class init_resolve_pageid_test extends DokuWikiTest { diff --git a/_test/tests/inc/parser/lexer.test.php b/_test/tests/inc/parser/lexer.test.php index 9b914fbd4..d0965a13e 100644 --- a/_test/tests/inc/parser/lexer.test.php +++ b/_test/tests/inc/parser/lexer.test.php @@ -9,168 +9,168 @@ * Includes */ require_once DOKU_INC . 'inc/parser/lexer.php'; - + /** * @package Doku * @subpackage Tests */ class TestOfLexerParallelRegex extends DokuWikiTest { - function testNoPatterns() { - $regex = new Doku_LexerParallelRegex(false); - $this->assertFalse($regex->match("Hello", $match)); - $this->assertEquals($match, ""); - } - function testNoSubject() { - $regex = new Doku_LexerParallelRegex(false); - $regex->addPattern(".*"); - $this->assertTrue($regex->match("", $match)); - $this->assertEquals($match, ""); - } - function testMatchAll() { - $regex = new Doku_LexerParallelRegex(false); - $regex->addPattern(".*"); - $this->assertTrue($regex->match("Hello", $match)); - $this->assertEquals($match, "Hello"); - } - function testCaseSensitive() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("abc"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEquals($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEquals($match, "abc"); - } - function testCaseInsensitive() { - $regex = new Doku_LexerParallelRegex(false); - $regex->addPattern("abc"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEquals($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEquals($match, "ABC"); - } - function testMatchMultiple() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("abc"); - $regex->addPattern("ABC"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEquals($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEquals($match, "ABC"); - $this->assertFalse($regex->match("Hello", $match)); - } - function testPatternLabels() { - $regex = new Doku_LexerParallelRegex(false); - $regex->addPattern("abc", "letter"); - $regex->addPattern("123", "number"); - $this->assertEquals($regex->match("abcdef", $match), "letter"); - $this->assertEquals($match, "abc"); - $this->assertEquals($regex->match("0123456789", $match), "number"); - $this->assertEquals($match, "123"); - } - function testMatchMultipleWithLookaheadNot() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("abc"); - $regex->addPattern("ABC"); - $regex->addPattern("a(?!\n).{1}"); - $this->assertTrue($regex->match("abcdef", $match)); - $this->assertEquals($match, "abc"); - $this->assertTrue($regex->match("AAABCabcdef", $match)); - $this->assertEquals($match, "ABC"); - $this->assertTrue($regex->match("a\nab", $match)); - $this->assertEquals($match, "ab"); - $this->assertFalse($regex->match("Hello", $match)); - } - function testMatchSetOptionCaseless() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("a(?i)b(?i)c"); - $this->assertTrue($regex->match("aBc", $match)); - $this->assertEquals($match, "aBc"); - } - function testMatchSetOptionUngreedy() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("(?U)\w+"); - $this->assertTrue($regex->match("aaaaaa", $match)); - $this->assertEquals($match, "a"); - } - function testMatchLookaheadEqual() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("\w(?=c)"); - $this->assertTrue($regex->match("xbyczd", $match)); - $this->assertEquals($match, "y"); - } - function testMatchLookaheadNot() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("\w(?!b|c)"); - $this->assertTrue($regex->match("xbyczd", $match)); - $this->assertEquals($match, "b"); - } - function testMatchLookbehindEqual() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("(?<=c)\w"); - $this->assertTrue($regex->match("xbyczd", $match)); - $this->assertEquals($match, "z"); - } - function testMatchLookbehindNot() { - $regex = new Doku_LexerParallelRegex(true); - $regex->addPattern("(?<!\A|x|b)\w"); - $this->assertTrue($regex->match("xbyczd", $match)); - $this->assertEquals($match, "c"); - } + function testNoPatterns() { + $regex = new Doku_LexerParallelRegex(false); + $this->assertFalse($regex->match("Hello", $match)); + $this->assertEquals($match, ""); + } + function testNoSubject() { + $regex = new Doku_LexerParallelRegex(false); + $regex->addPattern(".*"); + $this->assertTrue($regex->match("", $match)); + $this->assertEquals($match, ""); + } + function testMatchAll() { + $regex = new Doku_LexerParallelRegex(false); + $regex->addPattern(".*"); + $this->assertTrue($regex->match("Hello", $match)); + $this->assertEquals($match, "Hello"); + } + function testCaseSensitive() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("abc"); + $this->assertTrue($regex->match("abcdef", $match)); + $this->assertEquals($match, "abc"); + $this->assertTrue($regex->match("AAABCabcdef", $match)); + $this->assertEquals($match, "abc"); + } + function testCaseInsensitive() { + $regex = new Doku_LexerParallelRegex(false); + $regex->addPattern("abc"); + $this->assertTrue($regex->match("abcdef", $match)); + $this->assertEquals($match, "abc"); + $this->assertTrue($regex->match("AAABCabcdef", $match)); + $this->assertEquals($match, "ABC"); + } + function testMatchMultiple() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("abc"); + $regex->addPattern("ABC"); + $this->assertTrue($regex->match("abcdef", $match)); + $this->assertEquals($match, "abc"); + $this->assertTrue($regex->match("AAABCabcdef", $match)); + $this->assertEquals($match, "ABC"); + $this->assertFalse($regex->match("Hello", $match)); + } + function testPatternLabels() { + $regex = new Doku_LexerParallelRegex(false); + $regex->addPattern("abc", "letter"); + $regex->addPattern("123", "number"); + $this->assertEquals($regex->match("abcdef", $match), "letter"); + $this->assertEquals($match, "abc"); + $this->assertEquals($regex->match("0123456789", $match), "number"); + $this->assertEquals($match, "123"); + } + function testMatchMultipleWithLookaheadNot() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("abc"); + $regex->addPattern("ABC"); + $regex->addPattern("a(?!\n).{1}"); + $this->assertTrue($regex->match("abcdef", $match)); + $this->assertEquals($match, "abc"); + $this->assertTrue($regex->match("AAABCabcdef", $match)); + $this->assertEquals($match, "ABC"); + $this->assertTrue($regex->match("a\nab", $match)); + $this->assertEquals($match, "ab"); + $this->assertFalse($regex->match("Hello", $match)); + } + function testMatchSetOptionCaseless() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("a(?i)b(?i)c"); + $this->assertTrue($regex->match("aBc", $match)); + $this->assertEquals($match, "aBc"); + } + function testMatchSetOptionUngreedy() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("(?U)\w+"); + $this->assertTrue($regex->match("aaaaaa", $match)); + $this->assertEquals($match, "a"); + } + function testMatchLookaheadEqual() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("\w(?=c)"); + $this->assertTrue($regex->match("xbyczd", $match)); + $this->assertEquals($match, "y"); + } + function testMatchLookaheadNot() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("\w(?!b|c)"); + $this->assertTrue($regex->match("xbyczd", $match)); + $this->assertEquals($match, "b"); + } + function testMatchLookbehindEqual() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("(?<=c)\w"); + $this->assertTrue($regex->match("xbyczd", $match)); + $this->assertEquals($match, "z"); + } + function testMatchLookbehindNot() { + $regex = new Doku_LexerParallelRegex(true); + $regex->addPattern("(?<!\A|x|b)\w"); + $this->assertTrue($regex->match("xbyczd", $match)); + $this->assertEquals($match, "c"); + } } class TestOfLexerStateStack extends DokuWikiTest { - function testStartState() { - $stack = new Doku_LexerStateStack("one"); - $this->assertEquals($stack->getCurrent(), "one"); - } - function testExhaustion() { - $stack = new Doku_LexerStateStack("one"); - $this->assertFalse($stack->leave()); - } - function testStateMoves() { - $stack = new Doku_LexerStateStack("one"); - $stack->enter("two"); - $this->assertEquals($stack->getCurrent(), "two"); - $stack->enter("three"); - $this->assertEquals($stack->getCurrent(), "three"); - $this->assertTrue($stack->leave()); - $this->assertEquals($stack->getCurrent(), "two"); - $stack->enter("third"); - $this->assertEquals($stack->getCurrent(), "third"); - $this->assertTrue($stack->leave()); - $this->assertTrue($stack->leave()); - $this->assertEquals($stack->getCurrent(), "one"); - } + function testStartState() { + $stack = new Doku_LexerStateStack("one"); + $this->assertEquals($stack->getCurrent(), "one"); + } + function testExhaustion() { + $stack = new Doku_LexerStateStack("one"); + $this->assertFalse($stack->leave()); + } + function testStateMoves() { + $stack = new Doku_LexerStateStack("one"); + $stack->enter("two"); + $this->assertEquals($stack->getCurrent(), "two"); + $stack->enter("three"); + $this->assertEquals($stack->getCurrent(), "three"); + $this->assertTrue($stack->leave()); + $this->assertEquals($stack->getCurrent(), "two"); + $stack->enter("third"); + $this->assertEquals($stack->getCurrent(), "third"); + $this->assertTrue($stack->leave()); + $this->assertTrue($stack->leave()); + $this->assertEquals($stack->getCurrent(), "one"); + } } class TestParser { - function TestParser() { - } - function accept() { - } - function a() { - } - function b() { - } + function TestParser() { + } + function accept() { + } + function a() { + } + function b() { + } } class TestOfLexer extends DokuWikiTest { - function testNoPatterns() { + function testNoPatterns() { $handler = $this->getMock('TestParser'); $handler->expects($this->never())->method('accept'); - $lexer = new Doku_Lexer($handler); - $this->assertFalse($lexer->parse("abcdef")); - } - function testEmptyPage() { + $lexer = new Doku_Lexer($handler); + $this->assertFalse($lexer->parse("abcdef")); + } + function testEmptyPage() { $handler = $this->getMock('TestParser'); $handler->expects($this->never())->method('accept'); - $lexer = new Doku_Lexer($handler); - $lexer->addPattern("a+"); - $this->assertTrue($lexer->parse("")); - } - function testSinglePattern() { + $lexer = new Doku_Lexer($handler); + $lexer->addPattern("a+"); + $this->assertTrue($lexer->parse("")); + } + function testSinglePattern() { $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('accept') ->with("aaa", DOKU_LEXER_MATCHED, 0)->will($this->returnValue(true)); @@ -189,27 +189,27 @@ class TestOfLexer extends DokuWikiTest { $handler->expects($this->at(7))->method('accept') ->with("z", DOKU_LEXER_UNMATCHED, 13)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler); - $lexer->addPattern("a+"); - $this->assertTrue($lexer->parse("aaaxayyyaxaaaz")); - } - function testMultiplePattern() { - $handler = $this->getMock('TestParser', array('accept')); - $target = array("a", "b", "a", "bb", "x", "b", "a", "xxxxxx", "a", "x"); - $positions = array(0, 1, 2, 3, 5, 6, 7, 8, 14, 15); - for ($i = 0; $i < count($target); $i++) { + $lexer = new Doku_Lexer($handler); + $lexer->addPattern("a+"); + $this->assertTrue($lexer->parse("aaaxayyyaxaaaz")); + } + function testMultiplePattern() { + $handler = $this->getMock('TestParser', array('accept')); + $target = array("a", "b", "a", "bb", "x", "b", "a", "xxxxxx", "a", "x"); + $positions = array(0, 1, 2, 3, 5, 6, 7, 8, 14, 15); + for ($i = 0; $i < count($target); $i++) { $handler->expects($this->at($i))->method('accept') ->with($target[$i], $this->anything(), $positions[$i])->will($this->returnValue(true)); - } - $lexer = new Doku_Lexer($handler); - $lexer->addPattern("a+"); - $lexer->addPattern("b+"); - $this->assertTrue($lexer->parse("ababbxbaxxxxxxax")); - } + } + $lexer = new Doku_Lexer($handler); + $lexer->addPattern("a+"); + $lexer->addPattern("b+"); + $this->assertTrue($lexer->parse("ababbxbaxxxxxxax")); + } } class TestOfLexerModes extends DokuWikiTest { - function testIsolatedPattern() { + function testIsolatedPattern() { $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("a", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); @@ -227,12 +227,12 @@ class TestOfLexerModes extends DokuWikiTest { ->with("aaaa", DOKU_LEXER_MATCHED,11)->will($this->returnValue(true)); $handler->expects($this->at(7))->method('a') ->with("x", DOKU_LEXER_UNMATCHED,15)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addPattern("b+", "b"); - $this->assertTrue($lexer->parse("abaabxbaaaxaaaax")); - } - function testModeChange() { + $lexer = new Doku_Lexer($handler, "a"); + $lexer->addPattern("a+", "a"); + $lexer->addPattern("b+", "b"); + $this->assertTrue($lexer->parse("abaabxbaaaxaaaax")); + } + function testModeChange() { $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("a", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); @@ -261,13 +261,13 @@ class TestOfLexerModes extends DokuWikiTest { $handler->expects($this->at(12))->method('b') ->with("a", DOKU_LEXER_UNMATCHED,18)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addEntryPattern(":", "a", "b"); - $lexer->addPattern("b+", "b"); - $this->assertTrue($lexer->parse("abaabaaa:ababbabbba")); - } - function testNesting() { + $lexer = new Doku_Lexer($handler, "a"); + $lexer->addPattern("a+", "a"); + $lexer->addEntryPattern(":", "a", "b"); + $lexer->addPattern("b+", "b"); + $this->assertTrue($lexer->parse("abaabaaa:ababbabbba")); + } + function testNesting() { $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("aa", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); @@ -294,14 +294,14 @@ class TestOfLexerModes extends DokuWikiTest { $lexer = new Doku_Lexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addEntryPattern("(", "a", "b"); - $lexer->addPattern("b+", "b"); - $lexer->addExitPattern(")", "b"); - $this->assertTrue($lexer->parse("aabaab(bbabb)aab")); - } - function testSingular() { - $handler = $this->getMock('TestParser'); + $lexer->addPattern("a+", "a"); + $lexer->addEntryPattern("(", "a", "b"); + $lexer->addPattern("b+", "b"); + $lexer->addExitPattern(")", "b"); + $this->assertTrue($lexer->parse("aabaab(bbabb)aab")); + } + function testSingular() { + $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("aa", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); $handler->expects($this->at(1))->method('b') @@ -314,27 +314,27 @@ class TestOfLexerModes extends DokuWikiTest { ->with("bbb", DOKU_LEXER_SPECIAL,7)->will($this->returnValue(true)); $handler->expects($this->at(5))->method('a') ->with("xx", DOKU_LEXER_UNMATCHED,10)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addSpecialPattern("b+", "a", "b"); - $this->assertTrue($lexer->parse("aabaaxxbbbxx")); - } - function testUnwindTooFar() { - $handler = $this->getMock('TestParser'); + $lexer = new Doku_Lexer($handler, "a"); + $lexer->addPattern("a+", "a"); + $lexer->addSpecialPattern("b+", "a", "b"); + $this->assertTrue($lexer->parse("aabaaxxbbbxx")); + } + function testUnwindTooFar() { + $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("aa", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); $handler->expects($this->at(1))->method('a') ->with(")", DOKU_LEXER_EXIT,2)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "a"); - $lexer->addPattern("a+", "a"); - $lexer->addExitPattern(")", "a"); - $this->assertFalse($lexer->parse("aa)aa")); - } + $lexer = new Doku_Lexer($handler, "a"); + $lexer->addPattern("a+", "a"); + $lexer->addExitPattern(")", "a"); + $this->assertFalse($lexer->parse("aa)aa")); + } } class TestOfLexerHandlers extends DokuWikiTest { - function testModeMapping() { + function testModeMapping() { $handler = $this->getMock('TestParser'); $handler->expects($this->at(0))->method('a') ->with("aa", DOKU_LEXER_MATCHED,0)->will($this->returnValue(true)); @@ -351,32 +351,32 @@ class TestOfLexerHandlers extends DokuWikiTest { $handler->expects($this->at(6))->method('a') ->with("b", DOKU_LEXER_UNMATCHED,9)->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "mode_a"); - $lexer->addPattern("a+", "mode_a"); - $lexer->addEntryPattern("(", "mode_a", "mode_b"); - $lexer->addPattern("b+", "mode_b"); - $lexer->addExitPattern(")", "mode_b"); - $lexer->mapHandler("mode_a", "a"); - $lexer->mapHandler("mode_b", "a"); - $this->assertTrue($lexer->parse("aa(bbabb)b")); - } + $lexer = new Doku_Lexer($handler, "mode_a"); + $lexer->addPattern("a+", "mode_a"); + $lexer->addEntryPattern("(", "mode_a", "mode_b"); + $lexer->addPattern("b+", "mode_b"); + $lexer->addExitPattern(")", "mode_b"); + $lexer->mapHandler("mode_a", "a"); + $lexer->mapHandler("mode_b", "a"); + $this->assertTrue($lexer->parse("aa(bbabb)b")); + } } class TestParserByteIndex { - function TestParserByteIndex() {} + function TestParserByteIndex() {} - function ignore() {} + function ignore() {} - function caught() {} + function caught() {} } class TestOfLexerByteIndices extends DokuWikiTest { - function testIndex() { + function testIndex() { $doc = "aaa<file>bcd</file>eee"; - $handler = $this->getMock('TestParserByteIndex'); + $handler = $this->getMock('TestParserByteIndex'); $handler->expects($this->any())->method('ignore')->will($this->returnValue(true)); $handler->expects($this->at(1))->method('caught') ->with("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))->will($this->returnValue(true)); @@ -389,20 +389,20 @@ class TestOfLexerByteIndices extends DokuWikiTest { $handler->expects($this->at(5))->method('caught') ->with("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "ignore"); - $lexer->addEntryPattern("<file>", "ignore", "caught"); - $lexer->addExitPattern("</file>", "caught"); + $lexer = new Doku_Lexer($handler, "ignore"); + $lexer->addEntryPattern("<file>", "ignore", "caught"); + $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); $lexer->mapHandler('special','caught'); $lexer->addPattern('c','caught'); - $this->assertTrue($lexer->parse($doc)); - } + $this->assertTrue($lexer->parse($doc)); + } - function testIndexLookaheadEqual() { + function testIndexLookaheadEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = $this->getMock('TestParserByteIndex'); + $handler = $this->getMock('TestParserByteIndex'); $handler->expects($this->any())->method('ignore')->will($this->returnValue(true)); $handler->expects($this->at(1))->method('caught') ->with("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))->will($this->returnValue(true)); @@ -415,20 +415,20 @@ class TestOfLexerByteIndices extends DokuWikiTest { $handler->expects($this->at(5))->method('caught') ->with("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "ignore"); - $lexer->addEntryPattern('<file>(?=.*</file>)', "ignore", "caught"); - $lexer->addExitPattern("</file>", "caught"); + $lexer = new Doku_Lexer($handler, "ignore"); + $lexer->addEntryPattern('<file>(?=.*</file>)', "ignore", "caught"); + $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); $lexer->mapHandler('special','caught'); $lexer->addPattern('c','caught'); - $this->assertTrue($lexer->parse($doc)); - } + $this->assertTrue($lexer->parse($doc)); + } - function testIndexLookaheadNotEqual() { + function testIndexLookaheadNotEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = $this->getMock('TestParserByteIndex'); + $handler = $this->getMock('TestParserByteIndex'); $handler->expects($this->any())->method('ignore')->will($this->returnValue(true)); $handler->expects($this->at(1))->method('caught') ->with("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))->will($this->returnValue(true)); @@ -441,20 +441,20 @@ class TestOfLexerByteIndices extends DokuWikiTest { $handler->expects($this->at(5))->method('caught') ->with("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "ignore"); - $lexer->addEntryPattern('<file>(?!foo)', "ignore", "caught"); - $lexer->addExitPattern("</file>", "caught"); + $lexer = new Doku_Lexer($handler, "ignore"); + $lexer->addEntryPattern('<file>(?!foo)', "ignore", "caught"); + $lexer->addExitPattern("</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); $lexer->mapHandler('special','caught'); $lexer->addPattern('c','caught'); - $this->assertTrue($lexer->parse($doc)); - } + $this->assertTrue($lexer->parse($doc)); + } - function testIndexLookbehindEqual() { + function testIndexLookbehindEqual() { $doc = "aaa<file>bcd</file>eee"; - $handler = $this->getMock('TestParserByteIndex'); + $handler = $this->getMock('TestParserByteIndex'); $handler->expects($this->any())->method('ignore')->will($this->returnValue(true)); $handler->expects($this->at(1))->method('caught') ->with("<file>", DOKU_LEXER_ENTER, strpos($doc,'<file>'))->will($this->returnValue(true)); @@ -467,17 +467,17 @@ class TestOfLexerByteIndices extends DokuWikiTest { $handler->expects($this->at(5))->method('caught') ->with("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, "ignore"); - $lexer->addEntryPattern('<file>', "ignore", "caught"); - $lexer->addExitPattern("(?<=d)</file>", "caught"); + $lexer = new Doku_Lexer($handler, "ignore"); + $lexer->addEntryPattern('<file>', "ignore", "caught"); + $lexer->addExitPattern("(?<=d)</file>", "caught"); $lexer->addSpecialPattern('b','caught','special'); $lexer->mapHandler('special','caught'); $lexer->addPattern('c','caught'); - $this->assertTrue($lexer->parse($doc)); - } + $this->assertTrue($lexer->parse($doc)); + } - function testIndexLookbehindNotEqual() { + function testIndexLookbehindNotEqual() { $doc = "aaa<file>bcd</file>eee"; $handler = $this->getMock('TestParserByteIndex'); @@ -493,15 +493,15 @@ class TestOfLexerByteIndices extends DokuWikiTest { $handler->expects($this->at(5))->method('caught') ->with("</file>", DOKU_LEXER_EXIT, strpos($doc,'</file>'))->will($this->returnValue(true)); - $lexer = new Doku_Lexer($handler, 'ignore'); - $lexer->addEntryPattern('<file>', 'ignore', 'caught'); - $lexer->addExitPattern('(?<!c)</file>', 'caught'); + $lexer = new Doku_Lexer($handler, 'ignore'); + $lexer->addEntryPattern('<file>', 'ignore', 'caught'); + $lexer->addExitPattern('(?<!c)</file>', 'caught'); $lexer->addSpecialPattern('b','caught','special'); $lexer->mapHandler('special','caught'); $lexer->addPattern('c','caught'); - $this->assertTrue($lexer->parse($doc)); - } + $this->assertTrue($lexer->parse($doc)); + } /** * This test is primarily to ensure the correct match is chosen diff --git a/_test/tests/inc/parser/parser.inc.php b/_test/tests/inc/parser/parser.inc.php index 06c314ac6..e9efef0d3 100644 --- a/_test/tests/inc/parser/parser.inc.php +++ b/_test/tests/inc/parser/parser.inc.php @@ -1,24 +1,8 @@ <?php -/** -* @version $Id: parser.inc.php,v 1.2 2005/03/25 21:00:22 harryf Exp $ -* @package Doku -* @subpackage Tests -*/ -/** -* Includes -*/ -require_once DOKU_INC . 'inc/init.php'; -require_once DOKU_INC . 'inc/confutils.php'; require_once DOKU_INC . 'inc/parser/parser.php'; require_once DOKU_INC . 'inc/parser/handler.php'; -require_once DOKU_INC . 'inc/events.php'; -require_once DOKU_INC . 'inc/mail.php'; -/** -* @package Doku -* @subpackage Tests -*/ abstract class TestOfDoku_Parser extends PHPUnit_Framework_TestCase { var $P; diff --git a/_test/tests/inc/parser/parser_eol.test.php b/_test/tests/inc/parser/parser_eol.test.php index 03569bb62..6264f8b55 100644 --- a/_test/tests/inc/parser/parser_eol.test.php +++ b/_test/tests/inc/parser/parser_eol.test.php @@ -31,7 +31,7 @@ class TestOfDoku_Parser_Eol extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testWinEol() { $this->P->addMode('eol',new Doku_Parser_Mode_Eol()); $this->P->parse("Foo\r\nBar"); @@ -44,7 +44,7 @@ class TestOfDoku_Parser_Eol extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testLinebreak() { $this->P->addMode('linebreak',new Doku_Parser_Mode_Linebreak()); $this->P->parse('Foo\\\\ Bar'); @@ -59,12 +59,12 @@ class TestOfDoku_Parser_Eol extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testLinebreakPlusEol() { $this->P->addMode('linebreak',new Doku_Parser_Mode_Linebreak()); $this->P->addMode('eol',new Doku_Parser_Mode_Eol()); $this->P->parse('Foo\\\\'."\n\n".'Bar'); - + $calls = array ( array('document_start',array()), array('p_open',array()), @@ -78,7 +78,7 @@ class TestOfDoku_Parser_Eol extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testLinebreakInvalid() { $this->P->addMode('linebreak',new Doku_Parser_Mode_Linebreak()); $this->P->parse('Foo\\\\Bar'); diff --git a/_test/tests/inc/parser/parser_headers.test.php b/_test/tests/inc/parser/parser_headers.test.php index d7e5f0e42..a1bf7d2ba 100644 --- a/_test/tests/inc/parser/parser_headers.test.php +++ b/_test/tests/inc/parser/parser_headers.test.php @@ -21,7 +21,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeader2() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n ===== Header ===== \n def"); @@ -40,7 +40,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeader3() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n ==== Header ==== \n def"); @@ -59,7 +59,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeader4() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n === Header === \n def"); @@ -78,7 +78,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeader5() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n == Header == \n def"); @@ -116,7 +116,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeader2UnevenBigger() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n ===== Header =========== \n def"); @@ -135,7 +135,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeaderLarge() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n ======= Header ======= \n def"); @@ -154,7 +154,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeaderSmall() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n= Header =\n def"); @@ -167,8 +167,8 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - - + + function testHeader1Mixed() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n====== == Header == ======\n def"); @@ -206,7 +206,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + function testHeaderMultiline() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->parse("abc \n== ====== Header\n ====== ==\n def"); @@ -225,13 +225,13 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + # function testNoToc() { # $this->P->addMode('notoc',new Doku_Parser_Mode_NoToc()); # $this->P->parse('abc ~~NOTOC~~ def'); # $this->assertFalse($this->H->meta['toc']); # } - + function testHeader1Eol() { $this->P->addMode('header',new Doku_Parser_Mode_Header()); $this->P->addMode('eol',new Doku_Parser_Mode_Eol()); @@ -250,7 +250,7 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { array('document_end',array()), ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); - + } function testHeaderMulti2() { @@ -277,6 +277,6 @@ class TestOfDoku_Parser_Headers extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); } - + } diff --git a/_test/tests/inc/parser/parser_quote.test.php b/_test/tests/inc/parser/parser_quote.test.php index 4d77f2a39..ae14671c1 100644 --- a/_test/tests/inc/parser/parser_quote.test.php +++ b/_test/tests/inc/parser/parser_quote.test.php @@ -21,11 +21,11 @@ class TestOfDoku_Parser_Quote extends TestOfDoku_Parser { array('cdata',array("klm")), array('p_close',array()), array('document_end',array()), - + ); $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } - + function testQuoteWinCr() { $this->P->addMode('quote',new Doku_Parser_Mode_Quote()); $this->P->parse("abc\r\n> def\r\n>>ghi\r\nklm"); @@ -44,11 +44,11 @@ class TestOfDoku_Parser_Quote extends TestOfDoku_Parser { array('cdata',array("klm")), array('p_close',array()), array('document_end',array()), - + ); $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } - + function testQuoteMinumumContext() { $this->P->addMode('quote',new Doku_Parser_Mode_Quote()); $this->P->parse("\n> def\n>>ghi\n "); @@ -61,11 +61,11 @@ class TestOfDoku_Parser_Quote extends TestOfDoku_Parser { array('quote_close',array()), array('quote_close',array()), array('document_end',array()), - + ); $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } - + function testQuoteEol() { $this->P->addMode('quote',new Doku_Parser_Mode_Quote()); $this->P->addMode('eol',new Doku_Parser_Mode_Eol()); @@ -85,7 +85,7 @@ class TestOfDoku_Parser_Quote extends TestOfDoku_Parser { array('cdata',array("klm")), array('p_close',array()), array('document_end',array()), - + ); $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } diff --git a/_test/tests/inc/parser/parser_unformatted.test.php b/_test/tests/inc/parser/parser_unformatted.test.php index 7608cfd1c..f20ba5e8b 100644 --- a/_test/tests/inc/parser/parser_unformatted.test.php +++ b/_test/tests/inc/parser/parser_unformatted.test.php @@ -2,7 +2,7 @@ require_once 'parser.inc.php'; class TestOfDoku_Parser_Unformatted extends TestOfDoku_Parser { - + function testNowiki() { $this->P->addMode('unformatted',new Doku_Parser_Mode_Unformatted()); $this->P->parse("Foo <nowiki>testing</nowiki> Bar"); @@ -17,9 +17,9 @@ class TestOfDoku_Parser_Unformatted extends TestOfDoku_Parser { ); $this->assertEquals(array_map('stripByteIndex',$this->H->calls),$calls); - + } - + function testDoublePercent() { $this->P->addMode('unformatted',new Doku_Parser_Mode_Unformatted()); $this->P->parse("Foo %%testing%% Bar"); diff --git a/_test/tests/inc/parserutils_set_metadata_during_rendering.test.php b/_test/tests/inc/parserutils_set_metadata_during_rendering.test.php index 66371509c..0683848f1 100644 --- a/_test/tests/inc/parserutils_set_metadata_during_rendering.test.php +++ b/_test/tests/inc/parserutils_set_metadata_during_rendering.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/init.php'; - class parserutils_set_metadata_during_rendering_test extends DokuWikiTest { // the id used for this test case private $id; diff --git a/_test/tests/inc/remote.test.php b/_test/tests/inc/remote.test.php index 5dc868295..94f66538d 100644 --- a/_test/tests/inc/remote.test.php +++ b/_test/tests/inc/remote.test.php @@ -1,9 +1,5 @@ <?php -require_once DOKU_INC . 'inc/init.php'; -require_once DOKU_INC . 'inc/RemoteAPICore.php'; -require_once DOKU_INC . 'inc/auth/basic.class.php'; - class MockAuth extends auth_basic { function isCaseSensitive() { return true; } } diff --git a/_test/tests/inc/safefn.test.php b/_test/tests/inc/safefn.test.php index 78e08fec6..175b72dfc 100644 --- a/_test/tests/inc/safefn.test.php +++ b/_test/tests/inc/safefn.test.php @@ -1,8 +1,6 @@ <?php // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); -require_once DOKU_INC.'inc/utf8.php'; -require_once DOKU_INC.'inc/SafeFN.class.php'; class safeFN_test extends DokuWikiTest { @@ -34,7 +32,7 @@ class safeFN_test extends DokuWikiTest { $this->assertEquals(SafeFN::decode($safe),$utf8); } } - + function test2(){ $tests[] = array('совместимая','%td%ta%sy%t8%t1%td%te%t4%t8%sw%tr'); diff --git a/_test/tests/inc/search/search.test.php b/_test/tests/inc/search/search.test.php index f7ea469b9..33cc80e74 100644 --- a/_test/tests/inc/search/search.test.php +++ b/_test/tests/inc/search/search.test.php @@ -1,5 +1,4 @@ <?php -require_once DOKU_INC.'inc/init.php'; class search_test extends DokuWikiTest { function strip_index_data($entry) { diff --git a/_test/tests/inc/utf8_correctidx.test.php b/_test/tests/inc/utf8_correctidx.test.php index 5c37627b6..a704fd0e8 100644 --- a/_test/tests/inc/utf8_correctidx.test.php +++ b/_test/tests/inc/utf8_correctidx.test.php @@ -1,7 +1,6 @@ <?php // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); -require_once DOKU_INC.'inc/utf8.php'; class utf8_correctidx_test extends DokuWikiTest { diff --git a/_test/tests/inc/utf8_html.test.php b/_test/tests/inc/utf8_html.test.php index 94acc6d6c..bdebd9d45 100644 --- a/_test/tests/inc/utf8_html.test.php +++ b/_test/tests/inc/utf8_html.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; - // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); diff --git a/_test/tests/inc/utf8_stripspecials.test.php b/_test/tests/inc/utf8_stripspecials.test.php index 532430b60..c9dc3205f 100644 --- a/_test/tests/inc/utf8_stripspecials.test.php +++ b/_test/tests/inc/utf8_stripspecials.test.php @@ -1,7 +1,6 @@ <?php // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); -require_once DOKU_INC.'inc/utf8.php'; class utf8_stripspecials extends DokuWikiTest { diff --git a/_test/tests/inc/utf8_substr.test.php b/_test/tests/inc/utf8_substr.test.php index 19eea4eb4..758e8c9d4 100644 --- a/_test/tests/inc/utf8_substr.test.php +++ b/_test/tests/inc/utf8_substr.test.php @@ -1,7 +1,6 @@ <?php // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); -require_once DOKU_INC.'inc/utf8.php'; class utf8_substr_test extends DokuWikiTest { diff --git a/_test/tests/inc/utf8_unicode.test.php b/_test/tests/inc/utf8_unicode.test.php index a34fec86d..fde8c5d02 100644 --- a/_test/tests/inc/utf8_unicode.test.php +++ b/_test/tests/inc/utf8_unicode.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; - // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); diff --git a/_test/tests/inc/utf8_utf16be.test.php b/_test/tests/inc/utf8_utf16be.test.php index 0150a8e4a..6a12a01fd 100644 --- a/_test/tests/inc/utf8_utf16be.test.php +++ b/_test/tests/inc/utf8_utf16be.test.php @@ -1,7 +1,5 @@ <?php -require_once DOKU_INC.'inc/utf8.php'; - // use no mbstring help here if(!defined('UTF8_NOMBSTRING')) define('UTF8_NOMBSTRING',1); diff --git a/_test/tests/lib/exe/css_css_compress.test.php b/_test/tests/lib/exe/css_css_compress.test.php index 811b0cee8..a7c87b6a7 100644 --- a/_test/tests/lib/exe/css_css_compress.test.php +++ b/_test/tests/lib/exe/css_css_compress.test.php @@ -2,7 +2,6 @@ require_once DOKU_INC.'lib/exe/css.php'; - class css_css_compress_test extends DokuWikiTest { function test_mlcom1(){ diff --git a/_test/tests/lib/exe/js_js_compress.test.php b/_test/tests/lib/exe/js_js_compress.test.php index 75c69c347..cda05162d 100644 --- a/_test/tests/lib/exe/js_js_compress.test.php +++ b/_test/tests/lib/exe/js_js_compress.test.php @@ -2,7 +2,6 @@ require_once DOKU_INC.'lib/exe/js.php'; - class js_js_compress_test extends DokuWikiTest { function test_mlcom1(){ |