Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorChanaka Indrajith <pe.chanaka.ck@gmail.com>2012-05-14 16:16:17 +0400
committerChanaka Indrajith <pe.chanaka.ck@gmail.com>2012-05-14 16:16:17 +0400
commit30d57ff2d4df0a5e5ea6f3eeae9a091f08e09681 (patch)
tree65d65fbe078134bc69aa5f9fa32621aacacac609 /test
parentf04a4f8989ff3204eda8a18f00735acfae1385cb (diff)
Improved some test cases for modified functions in common.lib.php
Diffstat (limited to 'test')
-rw-r--r--test/libraries/common/PMA_getDivForSliderEffect_test.php19
-rw-r--r--test/libraries/common/PMA_getDropdown_test.php (renamed from test/libraries/common/PMA_GetDropdown_test.php)0
-rw-r--r--test/libraries/common/PMA_getRadioFields_test.php48
3 files changed, 45 insertions, 22 deletions
diff --git a/test/libraries/common/PMA_getDivForSliderEffect_test.php b/test/libraries/common/PMA_getDivForSliderEffect_test.php
index 79cb68c6cd..3b5d03ff95 100644
--- a/test/libraries/common/PMA_getDivForSliderEffect_test.php
+++ b/test/libraries/common/PMA_getDivForSliderEffect_test.php
@@ -22,8 +22,10 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$id = "test_id";
$message = "test_message";
- $this->expectOutputString('<div id="' . $id . '" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">');
- PMA_getDivForSliderEffect($id, $message);
+ $this->assertEquals(
+ PMA_getDivForSliderEffect($id, $message),
+ '<div id="' . $id . '" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">'
+ );
}
function testGetDivForSliderEffectTestClosed()
@@ -34,8 +36,11 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$id = "test_id";
$message = "test_message";
- $this->expectOutputString('<div id="' . $id . '" style="display: none; overflow:auto;" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">');
- PMA_getDivForSliderEffect($id, $message);
+ $this->assertEquals(
+ PMA_getDivForSliderEffect($id, $message),
+ '<div id="' . $id . '" style="display: none; overflow:auto;" class="pma_auto_slider" title="' . htmlspecialchars($message) . '">'
+ );
+
}
function testGetDivForSliderEffectTestDisabled()
@@ -46,7 +51,9 @@ class PMA_GetDivForSliderEffectTest extends PHPUnit_Framework_TestCase
$id = "test_id";
$message = "test_message";
- $this->expectOutputString('<div id="' . $id . '">');
- PMA_getDivForSliderEffect($id, $message);
+ $this->assertEquals(
+ PMA_getDivForSliderEffect($id, $message),
+ '<div id="' . $id . '">'
+ );
}
} \ No newline at end of file
diff --git a/test/libraries/common/PMA_GetDropdown_test.php b/test/libraries/common/PMA_getDropdown_test.php
index ab01d800be..ab01d800be 100644
--- a/test/libraries/common/PMA_GetDropdown_test.php
+++ b/test/libraries/common/PMA_getDropdown_test.php
diff --git a/test/libraries/common/PMA_getRadioFields_test.php b/test/libraries/common/PMA_getRadioFields_test.php
index 441213fff2..89db84ba75 100644
--- a/test/libraries/common/PMA_getRadioFields_test.php
+++ b/test/libraries/common/PMA_getRadioFields_test.php
@@ -19,8 +19,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$name = "test_display_radio";
$choices = array();
- $this->expectOutputString("");
- PMA_displayHtmlRadio($name, $choices);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices),
+ ""
+ );
}
function testGetRadioFields()
@@ -38,8 +40,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices),
+ $out
+ );
}
function testGetRadioFieldsWithChecked()
@@ -61,8 +65,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice),
+ $out
+ );
}
function testGetRadioFieldsWithCheckedWithClass()
@@ -87,8 +93,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice, true, false, $class);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice, true, false, $class),
+ $out
+ );
}
function testGetRadioFieldsWithoutBR()
@@ -109,8 +117,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice, false);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice, false),
+ $out
+ );
}
function testGetRadioFieldsEscapeLabelEscapeLabel()
@@ -132,8 +142,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice, true, true);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice, true, true),
+ $out
+ );
}
function testGetRadioFieldsEscapeLabelNotEscapeLabel()
@@ -155,8 +167,10 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice, true, false);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice, true, false),
+ $out
+ );
}
function testGetRadioFieldsEscapeLabelEscapeLabelWithClass()
@@ -181,7 +195,9 @@ class PMA_GetRadioFieldsTest extends PHPUnit_Framework_TestCase
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices, $checked_choice, true, true, $class);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices, $checked_choice, true, true, $class),
+ $out
+ );
}
} \ No newline at end of file