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
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;

View File

@@ -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__');

View File

@@ -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&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)));
}
public function decodeBBDataProvider()
public function decodeBBDataProvider()
{
return array(
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
*/
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('<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
*/
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('<div class="notice">Test Message</div>', $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));