Remove strError occurences.

This commit is contained in:
Michal Čihař
2010-05-24 11:27:08 +02:00
parent 0620f3df03
commit 88ff43da9f
3 changed files with 30 additions and 38 deletions

View File

@@ -231,8 +231,6 @@ function PMA_fatalError($error_message, $message_args = null)
// Loads the language file // Loads the language file
require_once './libraries/select_lang.lib.php'; require_once './libraries/select_lang.lib.php';
$GLOBALS['strError'] = __('Error');
// $text_dir is set in po file // $text_dir is set in po file
if (isset($text_dir)) { if (isset($text_dir)) {
$GLOBALS['text_dir'] = $text_dir; $GLOBALS['text_dir'] = $text_dir;

View File

@@ -20,16 +20,10 @@ $text_dir = __('ltr');
$strDocu = __('Documentation'); $strDocu = __('Documentation');
$strError = __('Error');
$strErrorSaveTable = __('Error saving coordinates for Designer.'); $strErrorSaveTable = __('Error saving coordinates for Designer.');
$strFormEmpty = __('Missing value in the form!'); $strFormEmpty = __('Missing value in the form!');
$strHide = __('Hide');
$strLatexContent = __('Content of table __TABLE__'); $strLatexContent = __('Content of table __TABLE__');
$strLatexContinued = __('(continued)'); $strLatexContinued = __('(continued)');
$strLatexStructure = __('Structure of table __TABLE__'); $strLatexStructure = __('Structure of table __TABLE__');

View File

@@ -77,7 +77,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
{ {
$this->object = new PMA_Message('test<&>', PMA_Message::ERROR); $this->object = new PMA_Message('test<&>', PMA_Message::ERROR);
$this->assertEquals($this->object, PMA_Message::error('test<&>')); $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 * test rawWarning method
*/ */
public function testRawWarning() public function testRawWarning()
{ {
$this->object = new PMA_Message('', PMA_Message::WARNING); $this->object = new PMA_Message('', PMA_Message::WARNING);
$this->object->setMessage('test<&>'); $this->object->setMessage('test<&>');
@@ -123,7 +123,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* test rawNotice method * test rawNotice method
*/ */
public function testRawNotice() public function testRawNotice()
{ {
$this->object = new PMA_Message('', PMA_Message::NOTICE); $this->object = new PMA_Message('', PMA_Message::NOTICE);
$this->object->setMessage('test<&>'); $this->object->setMessage('test<&>');
@@ -134,7 +134,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* test rawSuccess method * test rawSuccess method
*/ */
public function testRawSuccess() public function testRawSuccess()
{ {
$this->object = new PMA_Message('', PMA_Message::SUCCESS); $this->object = new PMA_Message('', PMA_Message::SUCCESS);
$this->object->setMessage('test<&>'); $this->object->setMessage('test<&>');
@@ -145,7 +145,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing isSuccess method * testing isSuccess method
*/ */
public function testIsSuccess() public function testIsSuccess()
{ {
$this->assertFalse($this->object->isSuccess()); $this->assertFalse($this->object->isSuccess());
$this->assertTrue($this->object->isSuccess(true)); $this->assertTrue($this->object->isSuccess(true));
@@ -154,7 +154,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing isNotice method * testing isNotice method
*/ */
public function testIsNotice() public function testIsNotice()
{ {
$this->assertTrue($this->object->isNotice()); $this->assertTrue($this->object->isNotice());
$this->object->isWarning(true); $this->object->isWarning(true);
@@ -165,7 +165,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing isWarning method * testing isWarning method
*/ */
public function testIsWarning() public function testIsWarning()
{ {
$this->assertFalse($this->object->isWarning()); $this->assertFalse($this->object->isWarning());
$this->assertTrue($this->object->isWarning(true)); $this->assertTrue($this->object->isWarning(true));
@@ -174,7 +174,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing isError method * testing isError method
*/ */
public function testIsError() public function testIsError()
{ {
$this->assertFalse($this->object->isError()); $this->assertFalse($this->object->isError());
$this->assertTrue($this->object->isError(true)); $this->assertTrue($this->object->isError(true));
@@ -183,7 +183,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testign setter of message * testign setter of message
*/ */
public function testSetMessage() public function testSetMessage()
{ {
$this->object->setMessage('test&<>', false); $this->object->setMessage('test&<>', false);
$this->assertEquals('test&<>', $this->object->getMessage()); $this->assertEquals('test&<>', $this->object->getMessage());
@@ -194,7 +194,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing setter of string * testing setter of string
*/ */
public function testSetString() public function testSetString()
{ {
$this->object->setString('test&<>', false); $this->object->setString('test&<>', false);
$this->assertEquals('test&<>', $this->object->getString()); $this->assertEquals('test&<>', $this->object->getString());
@@ -205,7 +205,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing add param method * testing add param method
*/ */
public function testAddParam() public function testAddParam()
{ {
$this->object->addParam(PMA_Message::notice('test')); $this->object->addParam(PMA_Message::notice('test'));
$this->assertEquals(array(PMA_Message::notice('test')), $this->object->getParams()); $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 * testing add string method
*/ */
public function testAddString() public function testAddString()
{ {
$this->object->addString('test', '*'); $this->object->addString('test', '*');
$this->assertEquals(array('*', PMA_Message::notice('test')), $this->object->getAddedMessages()); $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 * testing add messages method
*/ */
public function testAddMessages() public function testAddMessages()
{ {
$this->object->addMessages(array('test', PMA_Message::rawWarning('test')), '&'); $this->object->addMessages(array('test', PMA_Message::rawWarning('test')), '&');
$this->assertEquals(array('&', PMA_Message::rawNotice('test'), '&', PMA_Message::rawWarning('test')), $this->object->getAddedMessages()); $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 * testing add message method
*/ */
public function testAddMessage() public function testAddMessage()
{ {
$this->object->addMessage('test', ''); $this->object->addMessage('test', '');
$this->assertEquals(array(PMA_Message::rawNotice('test')), $this->object->getAddedMessages()); $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 * testing setter of params
*/ */
public function testSetParams() public function testSetParams()
{ {
$this->object->setParams('test&<>'); $this->object->setParams('test&<>');
$this->assertEquals('test&<>', $this->object->getParams()); $this->assertEquals('test&<>', $this->object->getParams());
@@ -262,14 +262,14 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* testing sanitize method * testing sanitize method
*/ */
public function testSanitize() public function testSanitize()
{ {
$this->object->setString('test&string<>', false); $this->object->setString('test&string<>', false);
$this->assertEquals('test&amp;string&lt;&gt;', PMA_Message::sanitize($this->object)); $this->assertEquals('test&amp;string&lt;&gt;', PMA_Message::sanitize($this->object));
$this->assertEquals(array('test&amp;string&lt;&gt;', 'test&amp;string&lt;&gt;'), PMA_Message::sanitize(array($this->object, $this->object))); $this->assertEquals(array('test&amp;string&lt;&gt;', 'test&amp;string&lt;&gt;'), PMA_Message::sanitize(array($this->object, $this->object)));
} }
public function decodeBBDataProvider() public function decodeBBDataProvider()
{ {
return array( return array(
array('[i]test[/i][i]aa[i/][em]test[/em]', '<em>test</em><em>aa[i/]<em>test</em>'), array('[i]test[/i][i]aa[i/][em]test[/em]', '<em>test</em><em>aa[i/]<em>test</em>'),
@@ -284,27 +284,27 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
* @dataProvider decodeBBDataProvider * @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 * 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'));
$this->assertEquals('test string', PMA_Message::format('test string', 'a')); $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('test string', array()));
$this->assertEquals('test string', PMA_Message::format('%s string', array('test'))); $this->assertEquals('test string', PMA_Message::format('%s string', array('test')));
} }
/** /**
* testing getHash method * testing getHash method
*/ */
public function testGetHash() public function testGetHash()
{ {
$this->object->setString('<&>test', false); $this->object->setString('<&>test', false);
$this->object->setMessage('<&>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 * getMessage test - with empty message and with non-empty string - not key in globals
* additional params are defined * additional params are defined
*/ */
public function testGetMessageWithoutMessageWithStringWithParams() public function testGetMessageWithoutMessageWithStringWithParams()
{ {
$this->object->setMessage(''); $this->object->setMessage('');
$this->object->setString('test string %s %s'); $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 * getMessage test - with empty message and with empty string
*/ */
public function testGetMessageWithoutMessageWithEmptyString() public function testGetMessageWithoutMessageWithEmptyString()
{ {
$this->object->setMessage(''); $this->object->setMessage('');
$this->object->setString(''); $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 * getMessage test - with empty message and with string, which is key to GLOBALS
* additional messages are defined * additional messages are defined
*/ */
public function testGetMessageWithoutMessageWithGlobalStringWithAddMessages() public function testGetMessageWithoutMessageWithGlobalStringWithAddMessages()
{ {
$GLOBALS['key'] = 'test message'; $GLOBALS['key'] = 'test message';
$this->object->setMessage(''); $this->object->setMessage('');
@@ -353,7 +353,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
* getMessage test - message is defined * getMessage test - message is defined
* message with BBCode 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->object->setMessage('[kbd]test[/kbd] [a@./Documentation.html#cfg_Example@_blank]test[/a]');
$this->assertEquals('<kbd>test</kbd> <a href="./Documentation.html#cfg_Example" target="_blank">test</a>', $this->object->getMessage()); $this->assertEquals('<kbd>test</kbd> <a href="./Documentation.html#cfg_Example" target="_blank">test</a>', $this->object->getMessage());
@@ -362,7 +362,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* getLevel test * getLevel test
*/ */
public function testGetLevel() public function testGetLevel()
{ {
$this->assertEquals('notice', $this->object->getLevel()); $this->assertEquals('notice', $this->object->getLevel());
$this->object->setNumber(PMA_Message::SUCCESS); $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) * testing display method (output string and _is_displayed varible)
*/ */
public function testDisplay() public function testDisplay()
{ {
$this->assertFalse($this->object->isDisplayed()); $this->assertFalse($this->object->isDisplayed());
$this->object->setMessage('Test Message'); $this->object->setMessage('Test Message');
@@ -390,7 +390,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* getDisplay test * getDisplay test
*/ */
public function testGetDisplay() public function testGetDisplay()
{ {
$this->object->setMessage('Test Message'); $this->object->setMessage('Test Message');
$this->assertEquals('<div class="notice">Test Message</div>', $this->object->getDisplay()); $this->assertEquals('<div class="notice">Test Message</div>', $this->object->getDisplay());
@@ -399,7 +399,7 @@ class PMA_Message_test extends PHPUnit_Extensions_OutputTestCase
/** /**
* isDisplayed test * isDisplayed test
*/ */
public function testIsDisplayed() public function testIsDisplayed()
{ {
$this->assertFalse($this->object->isDisplayed(false)); $this->assertFalse($this->object->isDisplayed(false));
$this->assertTrue($this->object->isDisplayed(true)); $this->assertTrue($this->object->isDisplayed(true));