1*504c13e8SAndreas Gohr<?php 2*504c13e8SAndreas Gohr 3*504c13e8SAndreas Gohrnamespace dokuwiki\test\Parsing\ParserMode; 4*504c13e8SAndreas Gohr 5*504c13e8SAndreas Gohruse dokuwiki\Parsing\ParserMode\Nocache; 6*504c13e8SAndreas Gohr 7*504c13e8SAndreas Gohrclass NocacheTest extends ParserTestBase 8*504c13e8SAndreas Gohr{ 9*504c13e8SAndreas Gohr function testNocache() 10*504c13e8SAndreas Gohr { 11*504c13e8SAndreas Gohr $this->P->addMode('nocache', new Nocache()); 12*504c13e8SAndreas Gohr $this->P->parse('Foo ~~NOCACHE~~ Bar'); 13*504c13e8SAndreas Gohr $calls = [ 14*504c13e8SAndreas Gohr ['document_start', []], 15*504c13e8SAndreas Gohr ['p_open', []], 16*504c13e8SAndreas Gohr ['cdata', ["\nFoo "]], 17*504c13e8SAndreas Gohr ['nocache', []], 18*504c13e8SAndreas Gohr ['cdata', [' Bar']], 19*504c13e8SAndreas Gohr ['p_close', []], 20*504c13e8SAndreas Gohr ['document_end', []], 21*504c13e8SAndreas Gohr ]; 22*504c13e8SAndreas Gohr $this->assertCalls($calls, $this->H->calls); 23*504c13e8SAndreas Gohr } 24*504c13e8SAndreas Gohr 25*504c13e8SAndreas Gohr function testNocacheNotInline() 26*504c13e8SAndreas Gohr { 27*504c13e8SAndreas Gohr $this->P->addMode('nocache', new Nocache()); 28*504c13e8SAndreas Gohr $this->P->parse('Foo ~~nocache~~ Bar'); 29*504c13e8SAndreas Gohr $calls = [ 30*504c13e8SAndreas Gohr ['document_start', []], 31*504c13e8SAndreas Gohr ['p_open', []], 32*504c13e8SAndreas Gohr ['cdata', ["\nFoo ~~nocache~~ Bar"]], 33*504c13e8SAndreas Gohr ['p_close', []], 34*504c13e8SAndreas Gohr ['document_end', []], 35*504c13e8SAndreas Gohr ]; 36*504c13e8SAndreas Gohr $this->assertCalls($calls, $this->H->calls); 37*504c13e8SAndreas Gohr } 38*504c13e8SAndreas Gohr} 39