1<?php 2 3namespace dokuwiki\test\Parsing\ParserMode; 4 5use dokuwiki\Parsing\ParserMode\Unformatted; 6 7class UnformattedTest extends ParserTestBase 8{ 9 10 function testNowiki() { 11 $this->P->addMode('unformatted',new Unformatted()); 12 $this->P->parse("Foo <nowiki>testing</nowiki> Bar"); 13 $calls = [ 14 ['document_start',[]], 15 ['p_open',[]], 16 ['cdata',["\n".'Foo ']], 17 ['unformatted',['testing']], 18 ['cdata',[' Bar']], 19 ['p_close',[]], 20 ['document_end',[]], 21 ]; 22 23 $this->assertCalls($calls, $this->H->calls); 24 25 } 26 27 function testDoublePercent() { 28 $this->P->addMode('unformatted',new Unformatted()); 29 $this->P->parse("Foo %%testing%% Bar"); 30 $calls = [ 31 ['document_start',[]], 32 ['p_open',[]], 33 ['cdata',["\n".'Foo ']], 34 ['unformatted',['testing']], 35 ['cdata',[' Bar']], 36 ['p_close',[]], 37 ['document_end',[]], 38 ]; 39 $this->assertCalls($calls, $this->H->calls); 40 } 41} 42