PluginProbe
Responsive Menu – Create Mobile-Friendly Menu / 3.0.12
Responsive Menu – Create Mobile-Friendly Menu v3.0.12
4.7.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.10 4.1.11 4.1.12 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 All 90 releases
responsive-menu / tests / app / Translation / TranslatorTest.php

TranslatorTest.php in Responsive Menu – Create Mobile-Friendly Menu 3.0.12, at tests/app/Translation/TranslatorTest.php

51 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ResponsiveMenu\Translation;
4
5 use PHPUnit\Framework\TestCase;
6 use ResponsiveMenu\Collections\OptionsCollection;
7 use ResponsiveMenu\Models\Option;
8
9 class TranslatorTest extends TestCase {
10
11 public static function setUpBeforeClass() {
12 function apply_filters($a, $b, $c, $d) {
13 return $b;
14 }
15 function get_home_url() {
16 return 'home';
17 }
18 function do_action($a, $b, $c, $d) {
19 return $d;
20 }
21 function pll__($a) {
22 return $a;
23 }
24 function do_shortcode($a) {
25 return $a;
26 }
27 }
28 public function setUp() {
29 $this->translator = new Translator;
30 }
31
32 public function testSearchUrl() {
33 $this->assertEquals('home', $this->translator->searchUrl());
34 }
35
36 public function testSaveTranslations() {
37 $collection = new OptionsCollection;
38 $collection->add(new Option('menu_additional_content', 'a'));
39 $this->assertNull($this->translator->saveTranslations($collection));
40 }
41
42 public function testTranslate() {
43 $this->assertEquals('a', $this->translator->translate(new Option('menu_additional_content', 'a')));
44 }
45
46 public function testAllowShortcode() {
47 $this->assertEquals('a', $this->translator->allowShortcode('a'));
48 }
49
50 }
51