diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 70740b6ad..12e28c531 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -231,8 +231,6 @@ function PMA_fatalError($error_message, $message_args = null) // Loads the language file require_once './libraries/select_lang.lib.php'; - $GLOBALS['strError'] = __('Error'); - // $text_dir is set in po file if (isset($text_dir)) { $GLOBALS['text_dir'] = $text_dir; diff --git a/libraries/messages.inc.php b/libraries/messages.inc.php index 4f7d44892..3bd98878f 100644 --- a/libraries/messages.inc.php +++ b/libraries/messages.inc.php @@ -20,16 +20,10 @@ $text_dir = __('ltr'); $strDocu = __('Documentation'); -$strError = __('Error'); $strErrorSaveTable = __('Error saving coordinates for Designer.'); $strFormEmpty = __('Missing value in the form!'); -$strHide = __('Hide'); - - - - $strLatexContent = __('Content of table __TABLE__'); $strLatexContinued = __('(continued)'); $strLatexStructure = __('Structure of table __TABLE__'); diff --git a/test/PMA_Message_test.php b/test/PMA_Message_test.php index db6b25ecd..71cc8b392 100644 --- a/test/PMA_Message_test.php +++ b/test/PMA_Message_test.php @@ -77,7 +77,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase { $this->object = new PMA_Message('test<&>', PMA_Message::ERROR); $this->assertEquals($this->object, PMA_Message::error('test<&>')); - $this->assertEquals('strError', PMA_Message::error()->getString()); + $this->assertEquals('Error', PMA_Message::error()->getString()); } /** @@ -112,7 +112,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * test rawWarning method */ - public function testRawWarning() + public function testRawWarning() { $this->object = new PMA_Message('', PMA_Message::WARNING); $this->object->setMessage('test<&>'); @@ -123,7 +123,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * test rawNotice method */ - public function testRawNotice() + public function testRawNotice() { $this->object = new PMA_Message('', PMA_Message::NOTICE); $this->object->setMessage('test<&>'); @@ -134,7 +134,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * test rawSuccess method */ - public function testRawSuccess() + public function testRawSuccess() { $this->object = new PMA_Message('', PMA_Message::SUCCESS); $this->object->setMessage('test<&>'); @@ -145,7 +145,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing isSuccess method */ - public function testIsSuccess() + public function testIsSuccess() { $this->assertFalse($this->object->isSuccess()); $this->assertTrue($this->object->isSuccess(true)); @@ -154,7 +154,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing isNotice method */ - public function testIsNotice() + public function testIsNotice() { $this->assertTrue($this->object->isNotice()); $this->object->isWarning(true); @@ -165,7 +165,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing isWarning method */ - public function testIsWarning() + public function testIsWarning() { $this->assertFalse($this->object->isWarning()); $this->assertTrue($this->object->isWarning(true)); @@ -174,7 +174,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing isError method */ - public function testIsError() + public function testIsError() { $this->assertFalse($this->object->isError()); $this->assertTrue($this->object->isError(true)); @@ -183,7 +183,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testign setter of message */ - public function testSetMessage() + public function testSetMessage() { $this->object->setMessage('test&<>', false); $this->assertEquals('test&<>', $this->object->getMessage()); @@ -194,7 +194,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing setter of string */ - public function testSetString() + public function testSetString() { $this->object->setString('test&<>', false); $this->assertEquals('test&<>', $this->object->getString()); @@ -205,7 +205,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing add param method */ - public function testAddParam() + public function testAddParam() { $this->object->addParam(PMA_Message::notice('test')); $this->assertEquals(array(PMA_Message::notice('test')), $this->object->getParams()); @@ -218,7 +218,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing add string method */ - public function testAddString() + public function testAddString() { $this->object->addString('test', '*'); $this->assertEquals(array('*', PMA_Message::notice('test')), $this->object->getAddedMessages()); @@ -229,7 +229,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing add messages method */ - public function testAddMessages() + public function testAddMessages() { $this->object->addMessages(array('test', PMA_Message::rawWarning('test')), '&'); $this->assertEquals(array('&', PMA_Message::rawNotice('test'), '&', PMA_Message::rawWarning('test')), $this->object->getAddedMessages()); @@ -238,7 +238,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing add message method */ - public function testAddMessage() + public function testAddMessage() { $this->object->addMessage('test', ''); $this->assertEquals(array(PMA_Message::rawNotice('test')), $this->object->getAddedMessages()); @@ -251,7 +251,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing setter of params */ - public function testSetParams() + public function testSetParams() { $this->object->setParams('test&<>'); $this->assertEquals('test&<>', $this->object->getParams()); @@ -262,14 +262,14 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing sanitize method */ - public function testSanitize() + public function testSanitize() { $this->object->setString('test&string<>', false); $this->assertEquals('test&string<>', PMA_Message::sanitize($this->object)); $this->assertEquals(array('test&string<>', 'test&string<>'), PMA_Message::sanitize(array($this->object, $this->object))); } - public function decodeBBDataProvider() + public function decodeBBDataProvider() { return array( array('[i]test[/i][i]aa[i/][em]test[/em]', 'testaa[i/]test'), @@ -284,27 +284,27 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase * @dataProvider decodeBBDataProvider */ - public function testDecodeBB($actual, $expected) + public function testDecodeBB($actual, $expected) { - $this->assertEquals($expected, PMA_Message::decodeBB($actual)); + $this->assertEquals($expected, PMA_Message::decodeBB($actual)); } /** * testing format method */ - public function testFormat() + public function testFormat() { $this->assertEquals('test string', PMA_Message::format('test string')); $this->assertEquals('test string', PMA_Message::format('test string', 'a')); $this->assertEquals('test string', PMA_Message::format('test string', array())); $this->assertEquals('test string', PMA_Message::format('%s string', array('test'))); - + } /** * testing getHash method */ - public function testGetHash() + public function testGetHash() { $this->object->setString('<&>test', false); $this->object->setMessage('<&>test', false); @@ -315,7 +315,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase * getMessage test - with empty message and with non-empty string - not key in globals * additional params are defined */ - public function testGetMessageWithoutMessageWithStringWithParams() + public function testGetMessageWithoutMessageWithStringWithParams() { $this->object->setMessage(''); $this->object->setString('test string %s %s'); @@ -327,7 +327,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * getMessage test - with empty message and with empty string */ - public function testGetMessageWithoutMessageWithEmptyString() + public function testGetMessageWithoutMessageWithEmptyString() { $this->object->setMessage(''); $this->object->setString(''); @@ -338,7 +338,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase * getMessage test - with empty message and with string, which is key to GLOBALS * additional messages are defined */ - public function testGetMessageWithoutMessageWithGlobalStringWithAddMessages() + public function testGetMessageWithoutMessageWithGlobalStringWithAddMessages() { $GLOBALS['key'] = 'test message'; $this->object->setMessage(''); @@ -353,7 +353,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase * getMessage test - message is defined * message with BBCode defined */ - public function testGetMessageWithMessageWithBBCode() + public function testGetMessageWithMessageWithBBCode() { $this->object->setMessage('[kbd]test[/kbd] [a@./Documentation.html#cfg_Example@_blank]test[/a]'); $this->assertEquals('test test', $this->object->getMessage()); @@ -362,7 +362,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * getLevel test */ - public function testGetLevel() + public function testGetLevel() { $this->assertEquals('notice', $this->object->getLevel()); $this->object->setNumber(PMA_Message::SUCCESS); @@ -376,7 +376,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * testing display method (output string and _is_displayed varible) */ - public function testDisplay() + public function testDisplay() { $this->assertFalse($this->object->isDisplayed()); $this->object->setMessage('Test Message'); @@ -390,7 +390,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * getDisplay test */ - public function testGetDisplay() + public function testGetDisplay() { $this->object->setMessage('Test Message'); $this->assertEquals('
Test Message
', $this->object->getDisplay()); @@ -399,7 +399,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase /** * isDisplayed test */ - public function testIsDisplayed() + public function testIsDisplayed() { $this->assertFalse($this->object->isDisplayed(false)); $this->assertTrue($this->object->isDisplayed(true));