Translated using Weblate (Japanese)
[phpmyadmin.git] / test / libraries / PMA_config_functions_test.php
blobca8ee07c7d7a49dc89dbbab2c54cc8c6154976a6
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Tests for Config Functions
6 * @package PhpMyAdmin-test
7 */
9 /*
10 * Include to test.
12 require_once 'libraries/config/config_functions.lib.php';
14 /**
15 * Tests for Config Functions
17 * @package PhpMyAdmin-test
19 class PMA_Config_Functions_Test extends PHPUnit_Framework_TestCase
21 /**
22 * Test for PMA_lang
24 * @return void
25 * @test
27 public function testPMALang()
29 $this->assertEquals(
30 "&lt;a attr='value'&gt;test&lt;/a&gt;",
31 PMA_lang("<a attr='value'>test</a>")
34 $GLOBALS["strConfiglangKeyFooBar"] = "<a attr='value'>[em]test[/em]</a>";
36 $this->assertEquals(
37 "&lt;a attr='value'&gt;<em>test</em>&lt;/a&gt;",
38 PMA_lang("langKeyFooBar")
41 $this->assertEquals(
42 "1988-08-01",
43 PMA_lang("%04d-%02d-%02d", "1988", "8", "1")
47 /**
48 * Test for PMA_langName
50 * @return void
51 * @test
53 public function testLangName()
55 $canonicalPath = "Servers/1/2test";
57 $this->assertEquals(
58 "Servers_2test_name",
59 PMA_langName($canonicalPath)
62 $this->assertEquals(
63 "returnsDefault",
64 PMA_langName($canonicalPath, "name", "returnsDefault")
67 $GLOBALS["strConfigServers_2test_name"] = "<a>msg</a>";
69 $this->assertEquals(
70 "<a>msg</a>",
71 PMA_langName($canonicalPath)
74 $GLOBALS["strConfigServers_2test_desc"] = "<a>msg</a>";
76 $this->assertEquals(
77 "&lt;a&gt;msg&lt;/a&gt;",
78 PMA_langName($canonicalPath, "desc")