1<?php
2/**
3 * Tests for the replacement in the preventzerowidthchars plugin
4 *
5 * @group plugin_preventzerowidthchars
6 * @group plugins
7 */
8class replacement_plugin_preventzerowidthchars_test extends DokuWikiTest {
9    protected $pluginsEnabled = array('preventzerowidthchars');
10
11    public function replacement_data() {
12        return [
13            [
14                'http://​php.net/​images/​php.gif',
15                'http://php.net/images/php.gif',
16                '<200b>',
17            ]
18        ];
19    }
20
21    /**
22     * @param $input
23     * @param $expected_output
24     * @param $msg
25     *
26     * @dataProvider replacement_data
27     */
28    public function test_replacement($input, $expected_output, $msg) {
29        /** @var action_plugin_preventzerowidthchars $action */
30        $action = plugin_load('action', 'preventzerowidthchars');
31
32        $actual_output = $action->replaceZeroWidthChars($input);
33
34        $this->assertEquals($expected_output, $actual_output, 'Failed to remove ' . $msg);
35    }
36}
37