diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-08-01 11:37:00 +0200 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-08-01 11:37:00 +0200 |
commit | fdd9bab63c332a19e213c2cf7c986b8b95e25af6 (patch) | |
tree | be36b96db26ec7d3ba5948ee8a2dbbe890ae01ec /_test/tests | |
parent | 0d21c87f31bb8931973f720c04346bf5f8612470 (diff) | |
download | rpg-fdd9bab63c332a19e213c2cf7c986b8b95e25af6.tar.gz rpg-fdd9bab63c332a19e213c2cf7c986b8b95e25af6.tar.bz2 |
increase test coverage for code and file
code - test correct recognition of downloadable filename token
file - test correct recognition of syntax name & downloadable filename tokens
Diffstat (limited to '_test/tests')
-rw-r--r-- | _test/tests/inc/parser/parser_code.test.php | 16 | ||||
-rw-r--r-- | _test/tests/inc/parser/parser_file.test.php | 28 |
2 files changed, 44 insertions, 0 deletions
diff --git a/_test/tests/inc/parser/parser_code.test.php b/_test/tests/inc/parser/parser_code.test.php index 4f89b4826..c50d2d328 100644 --- a/_test/tests/inc/parser/parser_code.test.php +++ b/_test/tests/inc/parser/parser_code.test.php @@ -40,6 +40,22 @@ class TestOfDoku_Parser_Code extends TestOfDoku_Parser { $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } + function testCodeDownload() { + $this->P->parse('Foo <code bash script.sh>Test</code> Bar'); + $calls = array ( + array('document_start',array()), + array('p_open',array()), + array('cdata',array("\n".'Foo ')), + array('p_close',array()), + array('code',array('Test','bash','script.sh')), + array('p_open',array()), + array('cdata',array(' Bar')), + array('p_close',array()), + array('document_end',array()), + ); + $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); + } + function testCodeToken() { $this->P->parse('Foo <code2>Bar</code2><code>Test</code>'); $calls = array ( diff --git a/_test/tests/inc/parser/parser_file.test.php b/_test/tests/inc/parser/parser_file.test.php index 924b00382..39bda8a58 100644 --- a/_test/tests/inc/parser/parser_file.test.php +++ b/_test/tests/inc/parser/parser_file.test.php @@ -24,5 +24,33 @@ class TestOfDoku_Parser_File extends TestOfDoku_Parser { $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); } + function testFileHighlightDownload() { + $this->P->parse('Foo <file txt test.txt>Test</file> Bar'); + $calls = array ( + array('document_start',array()), + array('p_open',array()), + array('cdata',array("\n".'Foo ')), + array('p_close',array()), + array('file',array('Test','txt','test.txt')), + array('p_open',array()), + array('cdata',array(' Bar')), + array('p_close',array()), + array('document_end',array()), + ); + $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); + } + + function testFileToken() { + $this->P->parse('Foo <file2>Test</file2> Bar'); + $calls = array ( + array('document_start',array()), + array('p_open',array()), + array('cdata',array("\n".'Foo <file2>Test</file2> Bar')), + array('p_close',array()), + array('document_end',array()), + ); + $this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls); + } + } |