1<?php
2
3/**
4 * Test emoji conflicts with other syntax
5 */
6class emoji_conflicts_test extends DokuWikiTest {
7    function setup() {
8        $this->pluginsEnabled[] = 'emoji';
9        parent::setup();
10    }
11    function test_emoji_spaces() {
12        saveWikiText('emoji_page', "C:D ", 'Test');
13        $this->assertNotContains('&#x1f603;', p_wiki_xhtml('emoji_page'), 'Emoji without spaces.');
14    }
15    function test_emoji_vs_path() {
16        saveWikiText('emoji_page', "C:\\D ", 'Test');
17        $this->assertNotContains('&#x1f615;', p_wiki_xhtml('emoji_page'), 'Emoji conflicts with path.');
18    }
19    function test_emoji_vs_wiki_path() {
20        saveWikiText('emoji_page', "x :path", 'Test');
21        $this->assertNotContains('&#x1f61b;', p_wiki_xhtml('emoji_page'), 'Emoji conflicts with wiki path.');
22    }
23    function test_emoji_vs_monospace() {
24        saveWikiText('emoji_page', "x '':::'' x", 'Test');
25        $this->assertNotContains('&#039;', p_wiki_xhtml('emoji_page'), 'Emoji conflicts with monospace.');
26    }
27    function test_emoji_vs_footnote() {
28        saveWikiText('emoji_page', '((** X **))', 'Test');
29        $this->assertNotContains('&#x1f609;', p_wiki_xhtml('emoji_page'), 'Emoji conflicts with footnote.');
30    }
31}
32