P->addMode('file',new File()); } function testFile() { $this->P->parse('Foo Test Bar'); $calls = [ ['document_start',[]], ['p_open',[]], ['cdata',["\n".'Foo ']], ['p_close',[]], ['file',['Test',null,null]], ['p_open',[]], ['cdata',[' Bar']], ['p_close',[]], ['document_end',[]], ]; $this->assertCalls($calls, $this->H->calls); } function testFileHighlightDownload() { $this->P->parse('Foo Test Bar'); $calls = [ ['document_start',[]], ['p_open',[]], ['cdata',["\n".'Foo ']], ['p_close',[]], ['file',['Test','txt','test.txt']], ['p_open',[]], ['cdata',[' Bar']], ['p_close',[]], ['document_end',[]], ]; $this->assertCalls($calls, $this->H->calls); } function testFileToken() { $this->P->parse('Foo Test Bar'); $calls = [ ['document_start',[]], ['p_open',[]], ['cdata',["\n".'Foo Test Bar']], ['p_close',[]], ['document_end',[]], ]; $this->assertCalls($calls, $this->H->calls); } }