1<?php
2
3namespace dokuwiki\plugin\dev\test;
4
5use dokuwiki\plugin\dev\LangProcessor;
6use DokuWikiTest;
7
8/**
9 * FIXME tests for the dev plugin
10 *
11 * @group plugin_dev
12 * @group plugins
13 */
14class LangProcessorTest extends DokuWikiTest
15{
16
17    public function testPhpExtract()
18    {
19        $pl = new LangProcessor(new NullLogger());
20
21        $file = __DIR__ . '/testdata/test.php';
22        $result = $pl->phpExtract($file);
23
24        $this->assertEquals([
25            'string 1' => "$file:4",
26            'string 2' => "$file:4",
27            'string 3' => "$file:6",
28        ], $result);
29    }
30
31    public function testJsExtract()
32    {
33        $pl = new LangProcessor(new NullLogger());
34
35        $file = __DIR__ . '/testdata/test.js';
36        $result = $pl->jsExtract($file);
37
38        $this->assertEquals([
39            'string1' => "$file:1",
40            'string 2' => "$file:1",
41            'string 3' => "$file:3",
42            'string4' => "$file:5",
43            'string 5' => "$file:9",
44        ], $result);
45    }
46
47}
48
49