| @@ 114-128 (lines=15) @@ | ||
| 111 | $this->assertHtml($expected, $result); |
|
| 112 | } |
|
| 113 | ||
| 114 | public function testMaskLinkWithoutProtocol() |
|
| 115 | { |
|
| 116 | $input = '[url=thetempe.st/station]purge[/url]'; |
|
| 117 | $expected = [ |
|
| 118 | 'a' => [ |
|
| 119 | 'href' => 'http://thetempe.st/station', |
|
| 120 | 'rel' => 'external', |
|
| 121 | 'target' => '_blank' |
|
| 122 | ], |
|
| 123 | 'purge', |
|
| 124 | '/a' |
|
| 125 | ]; |
|
| 126 | $result = $this->_Parser->parse($input); |
|
| 127 | $this->assertHtml($expected, $result); |
|
| 128 | } |
|
| 129 | ||
| 130 | public function testParserEngineCaching() |
|
| 131 | { |
|
| @@ 323-334 (lines=12) @@ | ||
| 320 | $this->assertNotContains('>@Alice</a>', $result); |
|
| 321 | } |
|
| 322 | ||
| 323 | public function testAtLinkKnownUsersLinebreak() |
|
| 324 | { |
|
| 325 | $input = "@Alice\nfoo"; |
|
| 326 | $result = $this->_Parser->parse($input); |
|
| 327 | $expected = [ |
|
| 328 | 'a' => ['href' => '/at/Alice'], |
|
| 329 | '@Alice', |
|
| 330 | '/a', |
|
| 331 | 'br' => true |
|
| 332 | ]; |
|
| 333 | $this->assertHtml($expected, $result); |
|
| 334 | } |
|
| 335 | ||
| 336 | public function testLinkEmptyUrl() |
|
| 337 | { |
|
| @@ 946-959 (lines=14) @@ | ||
| 943 | $this->assertHtml($expected, $result); |
|
| 944 | } |
|
| 945 | ||
| 946 | public function testUploadTypeFile() |
|
| 947 | { |
|
| 948 | $input = '[file src=upload]test.txt[/file]'; |
|
| 949 | $expected = [ |
|
| 950 | 'a' => [ |
|
| 951 | 'href' => '/useruploads/test.txt', |
|
| 952 | 'target' => '_blank', |
|
| 953 | ], |
|
| 954 | 'test.txt', |
|
| 955 | '/a' |
|
| 956 | ]; |
|
| 957 | $result = $this->_Parser->parse($input); |
|
| 958 | $this->assertHtml($expected, $result); |
|
| 959 | } |
|
| 960 | ||
| 961 | public function testUploadTypeFileSrcNotValid() |
|
| 962 | { |
|