summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2009-12-01 20:16:22 +0100
committerAndreas Gohr <andi@splitbrain.org>2009-12-01 20:16:22 +0100
commitd947d6ab91f9939c59003d22b66a98e0a017d420 (patch)
tree006e96f6fbfe2852c8c9f7d3b02ceb8e65b17a9d
parent2e3d6a012d63f60e006fe88e0c61031d2a96c26d (diff)
downloadrpg-d947d6ab91f9939c59003d22b66a98e0a017d420.tar.gz
rpg-d947d6ab91f9939c59003d22b66a98e0a017d420.tar.bz2
fixed some test cases
Ignore-this: d14f492efbb4ef316895ef402308176e darcs-hash:20091201191622-7ad00-19deabc9820a59b447e891b7576c19641d554487.gz
-rw-r--r--_test/cases/inc/form_form.test.php4
-rw-r--r--_test/cases/inc/parser/parser_i18n.test.php26
-rw-r--r--_test/cases/inc/parser/parser_preformatted.test.php35
3 files changed, 33 insertions, 32 deletions
diff --git a/_test/cases/inc/form_form.test.php b/_test/cases/inc/form_form.test.php
index c342496fa..5d5fa72af 100644
--- a/_test/cases/inc/form_form.test.php
+++ b/_test/cases/inc/form_form.test.php
@@ -19,8 +19,8 @@ class form_test extends UnitTestCase {
function _realoutput() {
global $lang;
- $realoutput = '<form action="/test" method="post" ';
- $realoutput .= 'accept-charset="'.$lang['encoding'].'" id="dw__testform">';
+ $realoutput = '<form id="dw__testform" action="/test" method="post" ';
+ $realoutput .= 'accept-charset="'.$lang['encoding'].'">';
$realoutput .= "\n";
$realoutput .= '<div class="no"><input type="hidden" name="sectok" value="'.getSecurityToken().'" />';
$realoutput .= '<input type="hidden" name="summary" value="changes &amp;c" />';
diff --git a/_test/cases/inc/parser/parser_i18n.test.php b/_test/cases/inc/parser/parser_i18n.test.php
index 3601f604c..8d587fe0e 100644
--- a/_test/cases/inc/parser/parser_i18n.test.php
+++ b/_test/cases/inc/parser/parser_i18n.test.php
@@ -2,11 +2,11 @@
require_once 'parser.inc.php';
class TestOfDoku_Parser_i18n extends TestOfDoku_Parser {
-
+
function TestOfDoku_Parser_i18n() {
$this->UnitTestCase('TestOfDoku_Parser_i18n');
}
-
+
function testFormatting() {
$formats = array (
'strong', 'emphasis', 'underline', 'monospace',
@@ -53,7 +53,7 @@ class TestOfDoku_Parser_i18n extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testHeader() {
$this->P->addMode('header',new Doku_Parser_Mode_Header());
$this->P->parse("Foo\n ==== Iñtërnâtiônàlizætiøn ==== \n Bar");
@@ -74,7 +74,7 @@ class TestOfDoku_Parser_i18n extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testTable() {
$this->P->addMode('table',new Doku_Parser_Mode_Table());
$this->P->parse('
@@ -89,24 +89,24 @@ def');
array('p_close',array()),
array('table_open',array(3,2)),
array('tablerow_open',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Row 0 Col 1 ')),
array('tablecell_close',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Iñtërnâtiônàlizætiøn ')),
array('tablecell_close',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Row 0 Col 3 ')),
array('tablecell_close',array()),
array('tablerow_close',array()),
array('tablerow_open',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Row 1 Col 1 ')),
array('tablecell_close',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Iñtërnâtiônàlizætiøn ')),
array('tablecell_close',array()),
- array('tablecell_open',array(1,'left')),
+ array('tablecell_open',array(1,'left',1)),
array('cdata',array(' Row 1 Col 3 ')),
array('tablecell_close',array()),
array('tablerow_close',array()),
@@ -119,7 +119,7 @@ def');
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testAcronym() {
$t = array('Iñtërnâtiônàlizætiøn');
$this->P->addMode('acronym',new Doku_Parser_Mode_Acronym($t));
@@ -135,7 +135,7 @@ def');
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testInterwiki() {
$this->P->addMode('internallink',new Doku_Parser_Mode_InternalLink());
$this->P->parse("Foo [[wp>Iñtërnâtiônàlizætiøn|Iñtërnâtiônàlizætiøn]] Bar");
@@ -150,7 +150,7 @@ def');
);
$this->assertEqual(array_map('stripByteIndex',$this->H->calls),$calls);
}
-
+
function testInternalLink() {
$this->P->addMode('internallink',new Doku_Parser_Mode_InternalLink());
$this->P->parse("Foo [[x:Iñtërnâtiônàlizætiøn:y:foo_bar:z|Iñtërnâtiônàlizætiøn]] Bar");
diff --git a/_test/cases/inc/parser/parser_preformatted.test.php b/_test/cases/inc/parser/parser_preformatted.test.php
index 3891a7b3c..8e3bd591b 100644
--- a/_test/cases/inc/parser/parser_preformatted.test.php
+++ b/_test/cases/inc/parser/parser_preformatted.test.php
@@ -2,11 +2,11 @@
require_once 'parser.inc.php';
class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
-
+
function TestOfDoku_Parser_Preformatted() {
$this->UnitTestCase('TestOfDoku_Parser_Preformatted');
}
-
+
function testFile() {
$this->P->addMode('file',new Doku_Parser_Mode_File());
$this->P->parse('Foo <file>testing</file> Bar');
@@ -15,15 +15,16 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
array('p_close',array()),
- array('file',array('testing')),
+ array('file',array('testing',null,null)),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
array('document_end',array()),
);
+
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testCode() {
$this->P->addMode('code',new Doku_Parser_Mode_Code());
$this->P->parse('Foo <code>testing</code> Bar');
@@ -32,7 +33,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
array('p_close',array()),
- array('code',array('testing', NULL)),
+ array('code',array('testing', null, null)),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
@@ -40,7 +41,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testCodeWhitespace() {
$this->P->addMode('code',new Doku_Parser_Mode_Code());
$this->P->parse("Foo <code \n>testing</code> Bar");
@@ -49,7 +50,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
array('p_close',array()),
- array('code',array('testing', NULL)),
+ array('code',array('testing', null, null)),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
@@ -57,7 +58,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testCodeLang() {
$this->P->addMode('code',new Doku_Parser_Mode_Code());
$this->P->parse("Foo <code php>testing</code> Bar");
@@ -66,7 +67,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
array('p_close',array()),
- array('code',array('testing', 'php')),
+ array('code',array('testing', 'php', null)),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
@@ -74,7 +75,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testPreformatted() {
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
$this->P->parse("F oo\n x \n y \nBar\n");
@@ -91,7 +92,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testPreformattedWinEOL() {
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
$this->P->parse("F oo\r\n x \r\n y \r\nBar\r\n");
@@ -108,7 +109,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testPreformattedTab() {
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
$this->P->parse("F oo\n\tx\t\n\t\ty\t\nBar\n");
@@ -125,7 +126,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testPreformattedTabWinEOL() {
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
$this->P->parse("F oo\r\n\tx\t\r\n\t\ty\t\r\nBar\r\n");
@@ -142,7 +143,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
function testPreformattedList() {
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());
$this->P->addMode('listblock',new Doku_Parser_Mode_ListBlock());
@@ -174,7 +175,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
// test for php
function testPHP() {
@@ -192,7 +193,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
- // test with for HTML
+ // test with for HTML
function testHTML() {
$this->P->addMode('html',new Doku_Parser_Mode_HTML());
@@ -210,7 +211,7 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
}
-
+
function testPreformattedPlusHeaderAndEol() {
// Note that EOL must come after preformatted!
$this->P->addMode('preformatted',new Doku_Parser_Mode_Preformatted());