summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2005-10-22 23:05:19 +0200
committerAndreas Gohr <andi@splitbrain.org>2005-10-22 23:05:19 +0200
commitbc5021e986d7e06c99001e7c409afdf1d16335ff (patch)
treef2773f196691f6425d1c42476b4fe963830ab25f
parent840583dccde3ec4ca0a5a947d29b63a19fc3fbad (diff)
downloadrpg-bc5021e986d7e06c99001e7c409afdf1d16335ff.tar.gz
rpg-bc5021e986d7e06c99001e7c409afdf1d16335ff.tar.bz2
some test fixes (down to 67 failing ones)
darcs-hash:20051022210519-7ad00-5d4e204bd3c7cbe8a69f4c386c303e967c2d51cd.gz
-rw-r--r--_test/cases/inc/parser/lexer.group.php5
-rw-r--r--_test/cases/inc/parser/parser.group.php5
-rw-r--r--_test/cases/inc/parser/parser_i18n.test.php4
-rw-r--r--_test/cases/inc/parser/parser_preformatted.test.php59
-rwxr-xr-x_test/runtests.php2
5 files changed, 55 insertions, 20 deletions
diff --git a/_test/cases/inc/parser/lexer.group.php b/_test/cases/inc/parser/lexer.group.php
index 623cf6af5..cd2528ad7 100644
--- a/_test/cases/inc/parser/lexer.group.php
+++ b/_test/cases/inc/parser/lexer.group.php
@@ -6,11 +6,6 @@
*/
/**
-* Init
-*/
-require_once('./testconfig.php');
-
-/**
* @package JPSpan
* @subpackage Tests
*/
diff --git a/_test/cases/inc/parser/parser.group.php b/_test/cases/inc/parser/parser.group.php
index ca9084127..f1ba38e56 100644
--- a/_test/cases/inc/parser/parser.group.php
+++ b/_test/cases/inc/parser/parser.group.php
@@ -6,11 +6,6 @@
*/
/**
-* Init
-*/
-require_once('./testconfig.php');
-
-/**
* @package Dokuwiki
* @subpackage Tests
*/
diff --git a/_test/cases/inc/parser/parser_i18n.test.php b/_test/cases/inc/parser/parser_i18n.test.php
index f9609b07e..473ec6eec 100644
--- a/_test/cases/inc/parser/parser_i18n.test.php
+++ b/_test/cases/inc/parser/parser_i18n.test.php
@@ -62,10 +62,10 @@ class TestOfDoku_Parser_i18n extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array("\nFoo\n")),
array('p_close',array()),
- array('header',array(' Iñtërnâtiônàlizætiøn ',3)),
+ array('header',array('Iñtërnâtiônàlizætiøn',3,5)),
array('section_open',array(3)),
array('p_open',array()),
- array('cdata',array(" Bar\n")),
+ array('cdata',array("\n Bar\n")),
array('p_close',array()),
array('section_close',array()),
array('document_end',array()),
diff --git a/_test/cases/inc/parser/parser_preformatted.test.php b/_test/cases/inc/parser/parser_preformatted.test.php
index 2b5746216..7433cceae 100644
--- a/_test/cases/inc/parser/parser_preformatted.test.php
+++ b/_test/cases/inc/parser/parser_preformatted.test.php
@@ -175,15 +175,38 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
+ // test with PHP allowed
function testPHP() {
+ global $conf;
+ $conf['phpok'] = 1;
+
$this->P->addMode('php',new Doku_Parser_Mode_PHP());
$this->P->parse('Foo <php>testing</php> Bar');
$calls = array (
array('document_start',array()),
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
- array('p_close',array()),
array('php',array('testing')),
+ array('cdata',array(' Bar'."\n")),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
+ }
+
+ // test with PHP forbidden
+ function testPHPno() {
+ global $conf;
+ $conf['phpok'] = 0;
+
+ $this->P->addMode('php',new Doku_Parser_Mode_PHP());
+ $this->P->parse('Foo <php>testing</php> Bar');
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('cdata',array("\n".'Foo ')),
+ array('p_close',array()),
+ array('file',array('testing')),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
@@ -191,16 +214,39 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
-
+
+ // test with HTML allowed
function testHTML() {
+ global $conf;
+ $conf['htmlok'] = 1;
+
$this->P->addMode('html',new Doku_Parser_Mode_HTML());
$this->P->parse('Foo <html>testing</html> Bar');
$calls = array (
array('document_start',array()),
array('p_open',array()),
array('cdata',array("\n".'Foo ')),
- array('p_close',array()),
array('html',array('testing')),
+ array('cdata',array(' Bar'."\n")),
+ array('p_close',array()),
+ array('document_end',array()),
+ );
+ $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
+ }
+
+ // test with HTML forbidden
+ function testHTMLno() {
+ global $conf;
+ $conf['htmlok'] = 0;
+
+ $this->P->addMode('html',new Doku_Parser_Mode_HTML());
+ $this->P->parse('Foo <html>testing</html> Bar');
+ $calls = array (
+ array('document_start',array()),
+ array('p_open',array()),
+ array('cdata',array("\n".'Foo ')),
+ array('p_close',array()),
+ array('file',array('testing')),
array('p_open',array()),
array('cdata',array(' Bar'."\n")),
array('p_close',array()),
@@ -208,6 +254,9 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
}
+
+
+
function testPreformattedPlusHeaderAndEol() {
// Note that EOL must come after preformatted!
@@ -224,10 +273,6 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser {
array('p_open',array()),
array('cdata',array('Bar')),
array('p_close',array()),
- array('p_open',array()),
- array('p_close',array()),
- array('p_open',array()),
- array('p_close',array()),
array('document_end',array()),
);
$this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls);
diff --git a/_test/runtests.php b/_test/runtests.php
index 4e0f97b50..2260c7e0f 100755
--- a/_test/runtests.php
+++ b/_test/runtests.php
@@ -5,7 +5,7 @@ if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/
define('TEST_ROOT', dirname(__FILE__));
define('TMPL_FILESCHEME_PATH', TEST_ROOT . '/filescheme/');
define('TEST_RUNNING',TRUE);
-error_reporting(E_ALL);
+error_reporting(E_ALL ^ E_NOTICE);
require_once 'lib/testmanager.php';
TestManager::setup();