diff --git a/po/bn.po b/po/bn.po index d2499d22ab..6feec52ce3 100644 --- a/po/bn.po +++ b/po/bn.po @@ -13147,7 +13147,7 @@ msgid "" "value is, the better (This rules firing limit: 0.1%%)" msgstr "" "ইনসার্টেড অনুসন্ধানে অনুসন্ধান সরানোর হার %s%%। এর মান যত কম হবে তত ভাল, ভাল " -"(০.১%)" +"(০.১%%)" #: libraries/advisory_rules.txt:195 msgid "Query cache max size" diff --git a/po/hu.po b/po/hu.po index d2d1900234..53de8759a7 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12460,7 +12460,7 @@ msgid "" "invalidation if %ssession.gc_maxlifetime%s is lower than its value " "(currently %d)." msgstr "" -"Az 1440 másodpercnél magasabb %sLogin cookie validity% véletlenszerű " +"Az 1440 másodpercnél magasabb %sLogin cookie validity%s véletlenszerű " "munkamenet érvénytelenítést okozhat, ha %ssession.gc_maxlifetime%s " "alacsonyabb, mint az érték (jelenleg: %d)." diff --git a/test/libraries/PMA_relation_test.php b/test/libraries/PMA_relation_test.php new file mode 100644 index 0000000000..0e6dc31cc8 --- /dev/null +++ b/test/libraries/PMA_relation_test.php @@ -0,0 +1,141 @@ +getPath(); + $GLOBALS['pmaThemeImage'] = 'theme/'; + + include_once 'libraries/relation.lib.php'; + } + + /** + * Test for PMA_queryAsControlUser + * + * @return void + */ + public function testPMA_queryAsControlUser() + { + $dbi = $this->getMockBuilder('PMA_DatabaseInterface') + ->disableOriginalConstructor() + ->getMock(); + + $dbi->expects($this->once()) + ->method('query') + ->will($this->returnValue('executeResult1')); + + $dbi->expects($this->once()) + ->method('tryQuery') + ->will($this->returnValue('executeResult2')); + + $GLOBALS['dbi'] = $dbi; + + $sql = "insert into PMA_bookmark A,B values(1, 2)"; + $this->assertEquals( + 'executeResult1', + PMA_queryAsControlUser($sql) + ); + $this->assertEquals( + 'executeResult2', + PMA_queryAsControlUser($sql, false) + ); + } + + /** + * Test for PMA_getRelationsParam & PMA_getRelationsParamDiagnostic + * + * @return void + */ + public function testPMA_getRelationsParam() + { + $GLOBALS['cfg']['ServerDefault'] = 0; + $_SESSION['relation'] = array(); + + $relationsPara = PMA_getRelationsParam(); + $this->assertEquals( + false, + $relationsPara['relwork'] + ); + $this->assertEquals( + false, + $relationsPara['bookmarkwork'] + ); + $this->assertEquals( + 'root', + $relationsPara['user'] + ); + $this->assertEquals( + 'phpmyadmin', + $relationsPara['db'] + ); + + $retval = PMA_getRelationsParamDiagnostic($relationsPara); + //check $cfg['Servers'][$i]['pmadb'] + $this->assertContains( + "\$cfg['Servers'][\$i]['pmadb']", + $retval + ); + $this->assertContains( + 'OK', + $retval + ); + + //$cfg['Servers'][$i]['relation'] + $result = "\$cfg['Servers'][\$i]['pmadb'] ... " + . "OK"; + $this->assertContains( + $result, + $retval + ); + // $cfg['Servers'][$i]['relation'] + $result = "\$cfg['Servers'][\$i]['relation'] ... " + . "not OK"; + $this->assertContains( + $result, + $retval + ); + // General relation features + $result = 'General relation features: Disabled'; + $this->assertContains( + $result, + $retval + ); + // $cfg['Servers'][$i]['table_info'] + $result = "\$cfg['Servers'][\$i]['table_info'] ... " + . "not OK"; + $this->assertContains( + $result, + $retval + ); + // Display Features: + $result = 'Display Features: Disabled'; + $this->assertContains( + $result, + $retval + ); + } +} +