From f342ae92e0880da9d8a88123be054e597b2a7beb Mon Sep 17 00:00:00 2001 From: Chris Smith <chris@jalakai.co.uk> Date: Sat, 23 Feb 2008 07:31:45 +0100 Subject: [PATCH] Update php & html tests in preformatted test file to reflect changes in parser This test file examines the handler. The decisions on htmlok & phpok settings have been moved from the handler to the renderer changing the nature of the test that can be carried out on these syntax modes in this file. Refer other patch adding xhtml renderer tests for 'phpok' & 'htmlok' and their associated syntax modes in parser_preformatted.test.php darcs-hash:20080223063145-d26fc-3b449c7bd36f52fd278528f05c5df04f1df86771.gz --- .../inc/parser/parser_preformatted.test.php | 51 +------------------ 1 file changed, 2 insertions(+), 49 deletions(-) diff --git a/_test/cases/inc/parser/parser_preformatted.test.php b/_test/cases/inc/parser/parser_preformatted.test.php index df5980b59..3891a7b3c 100644 --- a/_test/cases/inc/parser/parser_preformatted.test.php +++ b/_test/cases/inc/parser/parser_preformatted.test.php @@ -175,10 +175,8 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser { $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls); } - // test with PHP allowed + // test for php function testPHP() { - global $conf; - $conf['phpok'] = 1; $this->P->addMode('php',new Doku_Parser_Mode_PHP()); $this->P->parse('Foo <php>testing</php> Bar'); @@ -194,31 +192,8 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser { $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()), - array('document_end',array()), - ); - $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls); - } - - // test with HTML allowed + // test with for HTML function testHTML() { - global $conf; - $conf['htmlok'] = 1; $this->P->addMode('html',new Doku_Parser_Mode_HTML()); $this->P->parse('Foo <html>testing</html> Bar'); @@ -234,28 +209,6 @@ class TestOfDoku_Parser_Preformatted extends TestOfDoku_Parser { $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()), - array('document_end',array()), - ); - $this->assertEqual(array_map('stripbyteindex',$this->H->calls),$calls); - } - - function testPreformattedPlusHeaderAndEol() { -- GitLab