Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved some test cases for modified functions in common.lib.php

  • Loading branch information...
commit 30d57ff2d4df0a5e5ea6f3eeae9a091f08e09681 1 parent f04a4f8
Chanaka Indrajith Dharmarathna Chanaka authored
19 test/libraries/common/PMA_getDivForSliderEffect_test.php
View
@@ -22,8 +22,10 @@ function testGetDivForSliderEffectTest()
$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 @@ function testGetDivForSliderEffectTestClosed()
$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 @@ function testGetDivForSliderEffectTestDisabled()
$id = "test_id";
$message = "test_message";
- $this->expectOutputString('<div id="' . $id . '">');
- PMA_getDivForSliderEffect($id, $message);
+ $this->assertEquals(
+ PMA_getDivForSliderEffect($id, $message),
+ '<div id="' . $id . '">'
+ );
}
}
0  test/libraries/common/PMA_GetDropdown_test.php → test/libraries/common/PMA_getDropdown_test.php
View
File renamed without changes
48 test/libraries/common/PMA_getRadioFields_test.php
View
@@ -19,8 +19,10 @@ function testGetRadioFieldsEmpty()
$name = "test_display_radio";
$choices = array();
- $this->expectOutputString("");
- PMA_displayHtmlRadio($name, $choices);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices),
+ ""
+ );
}
function testGetRadioFields()
@@ -38,8 +40,10 @@ function testGetRadioFields()
$out .= "\n";
}
- $this->expectOutputString($out);
- PMA_displayHtmlRadio($name, $choices);
+ $this->assertEquals(
+ PMA_getRadioFields($name, $choices),
+ $out
+ );
}
function testGetRadioFieldsWithChecked()
@@ -61,8 +65,10 @@ function testGetRadioFieldsWithChecked()
$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 @@ function testGetRadioFieldsWithCheckedWithClass()
$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 @@ function testGetRadioFieldsWithoutBR()
$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 @@ function testGetRadioFieldsEscapeLabelEscapeLabel()
$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 @@ function testGetRadioFieldsEscapeLabelNotEscapeLabel()
$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 @@ function testGetRadioFieldsEscapeLabelEscapeLabelWithClass()
$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
+ );
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.