xref: /dokuwiki/_test/tests/Parsing/ParserMode/CamelcaselinkTest.php (revision 465aec673bd9c2018b4df5364f08c816a70f03a7)
1*465aec67SAndreas Gohr<?php
2*465aec67SAndreas Gohr
3*465aec67SAndreas Gohrnamespace dokuwiki\test\Parsing\ParserMode;
4*465aec67SAndreas Gohr
5*465aec67SAndreas Gohruse dokuwiki\Parsing\ParserMode\Camelcaselink;
6*465aec67SAndreas Gohr
7*465aec67SAndreas Gohr/**
8*465aec67SAndreas Gohr * Tests for the {@see Camelcaselink} parser mode: bare CamelCase identifiers become internal page links.
9*465aec67SAndreas Gohr *
10*465aec67SAndreas Gohr * @group parser_links
11*465aec67SAndreas Gohr */
12*465aec67SAndreas Gohrclass CamelcaselinkTest extends ParserTestBase
13*465aec67SAndreas Gohr{
14*465aec67SAndreas Gohr    function testCamelCase() {
15*465aec67SAndreas Gohr        $this->P->addMode('camelcaselink', new Camelcaselink());
16*465aec67SAndreas Gohr        $this->P->parse("Foo FooBar Bar");
17*465aec67SAndreas Gohr        $calls = [
18*465aec67SAndreas Gohr            ['document_start', []],
19*465aec67SAndreas Gohr            ['p_open', []],
20*465aec67SAndreas Gohr            ['cdata', ["\n" . 'Foo ']],
21*465aec67SAndreas Gohr            ['camelcaselink', ['FooBar']],
22*465aec67SAndreas Gohr            ['cdata', [' Bar']],
23*465aec67SAndreas Gohr            ['p_close', []],
24*465aec67SAndreas Gohr            ['document_end', []],
25*465aec67SAndreas Gohr        ];
26*465aec67SAndreas Gohr        $this->assertCalls($calls, $this->H->calls);
27*465aec67SAndreas Gohr    }
28*465aec67SAndreas Gohr}
29