Merge pull request #573 from ayushchd/codestyle_fixes

Testsuite code-compliance fixes
This commit is contained in:
Michal Čihař 2013-08-07 10:41:08 -07:00
commit 036c128c56
35 changed files with 1130 additions and 204 deletions

View File

@ -40,7 +40,13 @@ $GLOBALS['runkit_internal_override'] = ini_get('runkit.internal_override');
/**
* Function to emulate headers() function by storing headers in GLOBAL array.
* Function to emulate headers() function by storing headers in GLOBAL array
*
* @param string $string header string
* @param boolean $replace .
* @param integer $http_response_code .
*
* @return void
*/
function test_header($string, $replace = true, $http_response_code = 200)
{
@ -53,6 +59,8 @@ function test_header($string, $replace = true, $http_response_code = 200)
/**
* Function to emulate headers_hest.
*
* @return boolean false
*/
function test_headers_sent()
{

View File

@ -56,7 +56,7 @@ class Advisor_Test extends PHPUnit_Framework_TestCase
$this->assertEquals($parseResult['errors'], array());
}
public function testADVISOR_bytime()
public function testAdvisorBytime()
{
$result = ADVISOR_bytime(10, 2);
$this->assertEquals("10 per second", $result);
@ -68,7 +68,7 @@ class Advisor_Test extends PHPUnit_Framework_TestCase
$this->assertEquals("10.8 per hour", $result);
}
public function testADVISOR_timespanFormat()
public function testAdvisorTimespanFormat()
{
$result = ADVISOR_timespanFormat(1200);
$this->assertEquals("0 days, 0 hours, 20 minutes and 0 seconds", $result);
@ -135,7 +135,8 @@ class Advisor_Test extends PHPUnit_Framework_TestCase
'id' => 'Variable',
'name' => 'Variable',
'issue' => 'issue',
'recommendation' => 'Recommend <a href="server_variables.php?lang=en&amp;token=token&filter=status_var">status_var</a>'
'recommendation' => 'Recommend <a href="server_variables.php?' .
'lang=en&amp;token=token&filter=status_var">status_var</a>'
),
null,
),
@ -195,7 +196,9 @@ class Advisor_Test extends PHPUnit_Framework_TestCase
'recommendation' => 'Recommend'
),
array(),
'Failed formatting string for rule \'Failure\'. PHP threw following error: Use of undefined constant fsafdsa - assumed \'fsafdsa\'',
'Failed formatting string for rule \'Failure\'. PHP threw ' .
'following error: Use of undefined constant fsafdsa - ' .
'assumed \'fsafdsa\'',
),
array(
array(
@ -208,7 +211,8 @@ class Advisor_Test extends PHPUnit_Framework_TestCase
'justification' => 'Version string (0)',
'name' => 'Distribution',
'issue' => 'official MySQL binaries.',
'recommendation' => 'See <a href="./url.php?url=http%3A%2F%2Fphpma.org%2F&amp;lang=en&amp;token=token">web</a>',
'recommendation' => 'See <a href="./url.php?url=http%3A%2F%2F' .
'phpma.org%2F&amp;lang=en&amp;token=token">web</a>',
'id' => 'Distribution'
),
null,

View File

@ -183,7 +183,8 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
'9.80',
),
array(
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/528.16 OmniWeb/622.8.0.112941',
'Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/'
. '528.16 OmniWeb/622.8.0.112941',
'Mac',
'OMNIWEB',
'622',
@ -201,25 +202,29 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
'9.0',
),
array(
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)',
'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; '
. 'Trident/6.0)',
'Win',
'IE',
'10.0',
),
array(
'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko',
'Mozilla/5.0 (IE 11.0; Windows NT 6.3; Trident/7.0; .NET4.0E; '
. '.NET4.0C; rv:11.0) like Gecko',
'Win',
'IE',
'11.0',
),
array(
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22',
'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, '
. 'like Gecko) Chrome/25.0.1364.172 Safari/537.22',
'Win',
'CHROME',
'25.0.1364.172',
),
array(
'Mozilla/5.0 (Unknown; U; Unix BSD/SYSV system; C -) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.10.2',
'Mozilla/5.0 (Unknown; U; Unix BSD/SYSV system; C -) '
. 'AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.10.2',
'Unix',
'SAFARI',
'5.0.419',
@ -231,7 +236,8 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
'1.9',
),
array(
'Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; amd64; en_US) KHTML/4.5.4 (like Gecko)',
'Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; '
. 'amd64; en_US) KHTML/4.5.4 (like Gecko)',
'Other',
'KONQUEROR',
),
@ -242,7 +248,8 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
'5.0',
),
array(
'Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0',
'Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20100101 '
. 'Firefox/12.0',
'Linux',
'FIREFOX',
'12.0',
@ -251,7 +258,8 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
* @todo Is this version really expected?
*/
array(
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.4+ (KHTML, like Gecko) Version/5.0 Safari/535.4+ SUSE/12.1 (3.2.1) Epiphany/3.2.1',
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.4+ (KHTML, like G'
. 'ecko) Version/5.0 Safari/535.4+ SUSE/12.1 (3.2.1) Epiphany/3.2.1',
'Linux',
'SAFARI',
'5.0',
@ -816,7 +824,10 @@ class PMA_ConfigTest extends PHPUnit_Framework_TestCase
$partial_sum = (
PHPUnit_Framework_Assert::readAttribute($this->object, 'source_mtime') +
PHPUnit_Framework_Assert::readAttribute($this->object, 'default_source_mtime') +
PHPUnit_Framework_Assert::readAttribute(
$this->object,
'default_source_mtime'
) +
$this->object->get('user_preferences_mtime') +
$_SESSION['PMA_Theme']->mtime_info +
$_SESSION['PMA_Theme']->filesize_info

View File

@ -17,6 +17,11 @@ require_once 'libraries/database_interface.inc.php';
require_once 'libraries/Tracker.class.php';
require_once 'libraries/relation.lib.php';
/**
* Tests for PMA_DBQbe class
*
* @package PhpMyAdmin-test
*/
class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
{
/**
@ -72,7 +77,10 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetSortSelectCell()
{
$this->assertEquals(
'<td class="center"><select style="width: 12ex" name="criteriaSort[1]" size="1"><option value="">&nbsp;</option><option value="ASC">Ascending</option><option value="DESC">Descending</option></select></td>',
'<td class="center"><select style="width: 12ex" name="criteriaSort[1]" '
. 'size="1"><option value="">&nbsp;</option><option value="ASC">'
. 'Ascending</option><option value="DESC">Descending</option>'
. '</select></td>',
$this->_callProtectedFunction(
'_getSortSelectCell',
array(1)
@ -88,7 +96,17 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetSortRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Sort:</th><td class="center"><select style="width: 12ex" name="criteriaSort[0]" size="1"><option value="">&nbsp;</option><option value="ASC">Ascending</option><option value="DESC">Descending</option></select></td><td class="center"><select style="width: 12ex" name="criteriaSort[1]" size="1"><option value="">&nbsp;</option><option value="ASC">Ascending</option><option value="DESC">Descending</option></select></td><td class="center"><select style="width: 12ex" name="criteriaSort[2]" size="1"><option value="">&nbsp;</option><option value="ASC">Ascending</option><option value="DESC">Descending</option></select></td></tr>',
'<tr class="even noclick"><th>Sort:</th><td class="center">'
. '<select style="width: 12ex" name="criteriaSort[0]" size="1">'
. '<option value="">&nbsp;</option><option value="ASC">Ascending'
. '</option><option value="DESC">Descending</option></select></td>'
. '<td class="center"><select style="width: 12ex" '
. 'name="criteriaSort[1]" size="1"><option value="">&nbsp;</option>'
. '<option value="ASC">Ascending</option><option value="DESC">'
. 'Descending</option></select></td><td class="center">'
. '<select style="width: 12ex" name="criteriaSort[2]" size="1">'
. '<option value="">&nbsp;</option><option value="ASC">Ascending'
. '</option><option value="DESC">Descending</option></select></td></tr>',
$this->_callProtectedFunction(
'_getSortRow',
array()
@ -104,7 +122,11 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetShowRow()
{
$this->assertEquals(
'<tr class="odd noclick"><th>Show:</th><td class="center"><input type="checkbox" name="criteriaShow[0]" /></td><td class="center"><input type="checkbox" name="criteriaShow[1]" /></td><td class="center"><input type="checkbox" name="criteriaShow[2]" /></td></tr>',
'<tr class="odd noclick"><th>Show:</th><td class="center"><input type'
. '="checkbox" name="criteriaShow[0]" /></td><td class="center">'
. '<input type="checkbox" name="criteriaShow[1]" /></td><td '
. 'class="center"><input type="checkbox" name="criteriaShow[2]" />'
. '</td></tr>',
$this->_callProtectedFunction(
'_getShowRow',
array()
@ -120,7 +142,16 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetCriteriaInputboxRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Criteria:</th><td class="center"><input type="hidden" name="prev_criteria[0]" value="" /><input type="text" name="criteria[0]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="hidden" name="prev_criteria[1]" value="" /><input type="text" name="criteria[1]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="hidden" name="prev_criteria[2]" value="" /><input type="text" name="criteria[2]" value="" class="textfield" style="width: 12ex" size="20" /></td></tr>',
'<tr class="even noclick"><th>Criteria:</th><td class="center">'
. '<input type="hidden" name="prev_criteria[0]" value="" />'
. '<input type="text" name="criteria[0]" value="" class="textfield" '
. 'style="width: 12ex" size="20" /></td><td class="center">'
. '<input type="hidden" name="prev_criteria[1]" value="" />'
. '<input type="text" name="criteria[1]" value="" class="textfield" '
. 'style="width: 12ex" size="20" /></td><td class="center">'
. '<input type="hidden" name="prev_criteria[2]" value="" />'
. '<input type="text" name="criteria[2]" value="" class="textfield" '
. 'style="width: 12ex" size="20" /></td></tr>',
$this->_callProtectedFunction(
'_getCriteriaInputboxRow',
array()
@ -136,7 +167,12 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetFootersOptions()
{
$this->assertEquals(
'<div class="floatleft">Add/Delete criteria rows:<select size="1" name="criteriaRowAdd"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select></div>',
'<div class="floatleft">Add/Delete criteria rows:<select size="1" '
. 'name="criteriaRowAdd"><option value="-3">-3</option><option '
. 'value="-2">-2</option><option value="-1">-1</option><option '
. 'value="0" selected="selected">0</option><option value="1">1'
. '</option><option value="2">2</option><option value="3">3</option>'
. '</select></div>',
$this->_callProtectedFunction(
'_getFootersOptions',
array('row')
@ -152,7 +188,18 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetTableFooters()
{
$this->assertEquals(
'<fieldset class="tblFooters"><div class="floatleft">Add/Delete criteria rows:<select size="1" name="criteriaRowAdd"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select></div><div class="floatleft">Add/Delete columns:<select size="1" name="criteriaColumnAdd"><option value="-3">-3</option><option value="-2">-2</option><option value="-1">-1</option><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option></select></div><div class="floatleft"><input type="submit" name="modify"value="Update Query" /></div></fieldset>',
'<fieldset class="tblFooters"><div class="floatleft">Add/Delete criteria'
. ' rows:<select size="1" name="criteriaRowAdd"><option value="-3">-3'
. '</option><option value="-2">-2</option><option value="-1">-1</option>'
. '<option value="0" selected="selected">0</option><option value="1">1'
. '</option><option value="2">2</option><option value="3">3</option>'
. '</select></div><div class="floatleft">Add/Delete columns:<select '
. 'size="1" name="criteriaColumnAdd"><option value="-3">-3</option>'
. '<option value="-2">-2</option><option value="-1">-1</option>'
. '<option value="0" selected="selected">0</option><option value="1">1'
. '</option><option value="2">2</option><option value="3">3</option>'
. '</select></div><div class="floatleft"><input type="submit" '
. 'name="modify"value="Update Query" /></div></fieldset>',
$this->_callProtectedFunction(
'_getTableFooters',
array()
@ -168,7 +215,12 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetAndOrColCell()
{
$this->assertEquals(
'<td class="center"><strong>Or:</strong><input type="radio" name="criteriaAndOrColumn[1]" value="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name="criteriaAndOrColumn[1]" value="and" /><br />Ins<input type="checkbox" name="criteriaColumnInsert[1]" />&nbsp;&nbsp;Del<input type="checkbox" name="criteriaColumnDelete[1]" /></td>',
'<td class="center"><strong>Or:</strong><input type="radio" '
. 'name="criteriaAndOrColumn[1]" value="or" />&nbsp;&nbsp;<strong>And:'
. '</strong><input type="radio" name="criteriaAndOrColumn[1]" value='
. '"and" /><br />Ins<input type="checkbox" name="criteriaColumnInsert'
. '[1]" />&nbsp;&nbsp;Del<input type="checkbox" '
. 'name="criteriaColumnDelete[1]" /></td>',
$this->_callProtectedFunction(
'_getAndOrColCell',
array(1)
@ -184,7 +236,23 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetModifyColumnsRow()
{
$this->assertEquals(
'<tr class="even noclick"><th>Modify:</th><td class="center"><strong>Or:</strong><input type="radio" name="criteriaAndOrColumn[0]" value="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name="criteriaAndOrColumn[0]" value="and" checked="checked" /><br />Ins<input type="checkbox" name="criteriaColumnInsert[0]" />&nbsp;&nbsp;Del<input type="checkbox" name="criteriaColumnDelete[0]" /></td><td class="center"><strong>Or:</strong><input type="radio" name="criteriaAndOrColumn[1]" value="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name="criteriaAndOrColumn[1]" value="and" checked="checked" /><br />Ins<input type="checkbox" name="criteriaColumnInsert[1]" />&nbsp;&nbsp;Del<input type="checkbox" name="criteriaColumnDelete[1]" /></td><td class="center"><strong>Or:</strong><input type="radio" name="criteriaAndOrColumn[2]" value="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name="criteriaAndOrColumn[2]" value="and" checked="checked" /><br />Ins<input type="checkbox" name="criteriaColumnInsert[2]" />&nbsp;&nbsp;Del<input type="checkbox" name="criteriaColumnDelete[2]" /></td></tr>',
'<tr class="even noclick"><th>Modify:</th><td class="center"><strong>'
. 'Or:</strong><input type="radio" name="criteriaAndOrColumn[0]" value'
. '="or" />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name='
. '"criteriaAndOrColumn[0]" value="and" checked="checked" /><br />Ins'
. '<input type="checkbox" name="criteriaColumnInsert[0]" />&nbsp;&nbsp;'
. 'Del<input type="checkbox" name="criteriaColumnDelete[0]" /></td><td '
. 'class="center"><strong>Or:</strong><input type="radio" name="'
. 'criteriaAndOrColumn[1]" value="or" />&nbsp;&nbsp;<strong>And:'
. '</strong><input type="radio" name="criteriaAndOrColumn[1]" value='
. '"and" checked="checked" /><br />Ins<input type="checkbox" name='
. '"criteriaColumnInsert[1]" />&nbsp;&nbsp;Del<input type="checkbox" '
. 'name="criteriaColumnDelete[1]" /></td><td class="center"><strong>Or:'
. '</strong><input type="radio" name="criteriaAndOrColumn[2]" value="or"'
. ' />&nbsp;&nbsp;<strong>And:</strong><input type="radio" name="criter'
. 'iaAndOrColumn[2]" value="and" checked="checked" /><br />Ins<input '
. 'type="checkbox" name="criteriaColumnInsert[2]" />&nbsp;&nbsp;Del'
. '<input type="checkbox" name="criteriaColumnDelete[2]" /></td></tr>',
$this->_callProtectedFunction(
'_getModifyColumnsRow',
array()
@ -201,7 +269,15 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['cell_align_right'] = 'cellAlign';
$this->assertEquals(
'<td class="cellAlign nowrap"><!-- Row controls --><table class="nospacing nopadding"><tr><td class="cellAlign nowrap"><small>Ins:</small><input type="checkbox" name="criteriaRowInsert[3]" /></td><td class="cellAlign"><strong>And:</strong></td><td><input type="radio" name="criteriaAndOrRow[3]" value="and" /></td></tr><tr><td class="cellAlign nowrap"><small>Del:</small><input type="checkbox" name="criteriaRowDelete[3]" /></td><td class="cellAlign"><strong>Or:</strong></td><td><input type="radio" name="criteriaAndOrRow[3]" value="or" checked="checked" /></td></tr></table></td>',
'<td class="cellAlign nowrap"><!-- Row controls --><table class="nospac'
. 'ing nopadding"><tr><td class="cellAlign nowrap"><small>Ins:</small>'
. '<input type="checkbox" name="criteriaRowInsert[3]" /></td><td '
. 'class="cellAlign"><strong>And:</strong></td><td><input type="radio" '
. 'name="criteriaAndOrRow[3]" value="and" /></td></tr><tr><td class="'
. 'cellAlign nowrap"><small>Del:</small><input type="checkbox" '
. 'name="criteriaRowDelete[3]" /></td><td class="cellAlign"><strong>'
. 'Or:</strong></td><td><input type="radio" name="criteriaAndOrRow[3]" '
. 'value="or" checked="checked" /></td></tr></table></td>',
$this->_callProtectedFunction(
'_getInsDelAndOrCell',
array(3, array('and' => '', 'or' => ' checked="checked"'))
@ -217,7 +293,12 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
public function testGetInputboxRow()
{
$this->assertEquals(
'<td class="center"><input type="text" name="Or2[0]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="text" name="Or2[1]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="text" name="Or2[2]" value="" class="textfield" style="width: 12ex" size="20" /></td>',
'<td class="center"><input type="text" name="Or2[0]" value="" class='
. '"textfield" style="width: 12ex" size="20" /></td><td class="center">'
. '<input type="text" name="Or2[1]" value="" class="textfield" '
. 'style="width: 12ex" size="20" /></td><td class="center"><input '
. 'type="text" name="Or2[2]" value="" class="textfield" style="width: '
. '12ex" size="20" /></td>',
$this->_callProtectedFunction(
'_getInputboxRow',
array(2,3)
@ -234,7 +315,21 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase
{
$GLOBALS['cell_align_right'] = 'cellAlign';
$this->assertEquals(
'<tr class="odd noclick"><td class="cellAlign nowrap"><!-- Row controls --><table class="nospacing nopadding"><tr><td class="cellAlign nowrap"><small>Ins:</small><input type="checkbox" name="criteriaRowInsert[0]" /></td><td class="cellAlign"><strong>And:</strong></td><td><input type="radio" name="criteriaAndOrRow[0]" value="and" /></td></tr><tr><td class="cellAlign nowrap"><small>Del:</small><input type="checkbox" name="criteriaRowDelete[0]" /></td><td class="cellAlign"><strong>Or:</strong></td><td><input type="radio" name="criteriaAndOrRow[0]" value="or" checked="checked" /></td></tr></table></td><td class="center"><input type="text" name="Or0[0]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="text" name="Or0[1]" value="" class="textfield" style="width: 12ex" size="20" /></td><td class="center"><input type="text" name="Or0[2]" value="" class="textfield" style="width: 12ex" size="20" /></td></tr>',
'<tr class="odd noclick"><td class="cellAlign nowrap"><!-- Row controls'
. ' --><table class="nospacing nopadding"><tr><td class="cellAlign '
. 'nowrap"><small>Ins:</small><input type="checkbox" name="'
. 'criteriaRowInsert[0]" /></td><td class="cellAlign"><strong>And:'
. '</strong></td><td><input type="radio" name="criteriaAndOrRow[0]" '
. 'value="and" /></td></tr><tr><td class="cellAlign nowrap"><small>Del:'
. '</small><input type="checkbox" name="criteriaRowDelete[0]" /></td>'
. '<td class="cellAlign"><strong>Or:</strong></td><td><input type='
. '"radio" name="criteriaAndOrRow[0]" value="or" checked="checked" />'
. '</td></tr></table></td><td class="center"><input type="text" '
. 'name="Or0[0]" value="" class="textfield" style="width: 12ex" '
. 'size="20" /></td><td class="center"><input type="text" name="Or0[1]" '
. 'value="" class="textfield" style="width: 12ex" size="20" /></td><td '
. 'class="center"><input type="text" name="Or0[2]" value="" class='
. '"textfield" style="width: 12ex" size="20" /></td></tr>',
$this->_callProtectedFunction(
'_getInsDelAndOrCriteriaRows',
array(2,3)

View File

@ -84,7 +84,8 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase
$this->assertEquals(
array (
'select_columns' => 'SELECT * FROM `pma`.`table1` WHERE FALSE',
'select_count' => 'SELECT COUNT(*) AS `count` FROM `pma`.`table1` WHERE FALSE',
'select_count' => 'SELECT COUNT(*) AS `count` FROM `pma`.`table1` ' .
'WHERE FALSE',
'delete' => 'DELETE FROM `pma`.`table1` WHERE FALSE'
),
$this->_callProtectedFunction(
@ -102,7 +103,8 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase
public function testGetSearchResults()
{
$this->assertEquals(
'<br /><table class="data"><caption class="tblHeaders">Search results for "<i></i>" :</caption></table>',
'<br /><table class="data"><caption class="tblHeaders">Search results '
. 'for "<i></i>" :</caption></table>',
$this->object->getSearchResults()
);
}
@ -150,7 +152,22 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase
'delete' => 'column2'
),
true,
'<tr class="noclick odd"><td>2 matches in <strong>table1</strong></td><td><a name="browse_search" href="sql.php?db=pma&amp;table=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;sql_query=column1&amp;server=0&amp;lang=en&amp;token=token" onclick="loadResult(\'sql.php?db=pma&amp;table=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;sql_query=column1&amp;server=0&amp;lang=en&amp;token=token\',\'table1\',\'db=pma&amp;table=table1&amp;server=0&amp;lang=en&amp;token=token\');return false;" >Browse</a></td><td><a name="delete_search" href="sql.php?db=pma&amp;table=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;sql_query=column2&amp;server=0&amp;lang=en&amp;token=token" onclick="deleteResult(\'sql.php?db=pma&amp;table=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;sql_query=column2&amp;server=0&amp;lang=en&amp;token=token\' , \'Delete the matches for the table1 table?\');return false;">Delete</a></td></tr>'
'<tr class="noclick odd"><td>2 matches in <strong>table1</strong>'
. '</td><td><a name="browse_search" href="sql.php?db=pma&amp;table'
. '=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;'
. 'sql_query=column1&amp;server=0&amp;lang=en&amp;token=token" '
. 'onclick="loadResult(\'sql.php?db=pma&amp;table=table1&amp;goto='
. 'db_sql.php&amp;pos=0&amp;is_js_confirmed=0&amp;sql_query=column1'
. '&amp;server=0&amp;lang=en&amp;token=token\',\'table1\',\'db=pma'
. '&amp;table=table1&amp;server=0&amp;lang=en&amp;token=token\');'
. 'return false;" >Browse</a></td><td><a name="delete_search" href'
. '="sql.php?db=pma&amp;table=table1&amp;goto=db_sql.php&amp;pos=0'
. '&amp;is_js_confirmed=0&amp;sql_query=column2&amp;server=0&amp;'
. 'lang=en&amp;token=token" onclick="deleteResult(\'sql.php?db=pma'
. '&amp;table=table1&amp;goto=db_sql.php&amp;pos=0&amp;is_js_'
. 'confirmed=0&amp;sql_query=column2&amp;server=0&amp;lang=en&amp;'
. 'token=token\' , \'Delete the matches for the table1 table?\');'
. 'return false;">Delete</a></td></tr>'
)
);
}
@ -166,15 +183,56 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase
$GLOBALS['pmaThemeImage'] = 'themes/dot.gif';
$url_params = array('param1', 'param2');
$this->assertEquals(
'<a id="db_search"></a><form id="db_search_form" class="ajax" method="post" action="db_search.php" name="db_search"><input type="hidden" name="db" value="pma" /><input type="hidden" name="lang" value="en" /><input type="hidden" name="token" value="token" /><fieldset><legend>Search in database</legend><table class="formlayout"><tr><td>Words or values to search for (wildcard: "%"):</td><td><input type="text" name="criteriaSearchString" size="60" value="" /></td></tr><tr><td class="right vtop">Find:</td><td><input type="radio" name="criteriaSearchType" id="criteriaSearchType_1" value="1" checked="checked" />
<label for="criteriaSearchType_1">at least one of the words<span class="pma_hint"><img src="themes/dot.gifb_help.png" title="" alt="" /><span class="hide">Words are separated by a space character (" ").</span></span></label><br />
<input type="radio" name="criteriaSearchType" id="criteriaSearchType_2" value="2" />
<label for="criteriaSearchType_2">all words<span class="pma_hint"><img src="themes/dot.gifb_help.png" title="" alt="" /><span class="hide">Words are separated by a space character (" ").</span></span></label><br />
<input type="radio" name="criteriaSearchType" id="criteriaSearchType_3" value="3" />
<label for="criteriaSearchType_3">the exact phrase</label><br />
<input type="radio" name="criteriaSearchType" id="criteriaSearchType_4" value="4" />
<label for="criteriaSearchType_4">as regular expression <a href="./url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen%2Fregexp.html&amp;server=0&amp;lang=en&amp;token=token" target="mysql_doc"><img src="themes/dot.gifb_help.png" title="Documentation" alt="Documentation" /></a></label><br />
</td></tr><tr><td class="right vtop">Inside tables:</td><td rowspan="2"><select name="criteriaTables[]" size="6" multiple="multiple"><option value="table1">table1</option><option value="table2">table2</option></select></td></tr><tr><td class="right vbottom"><a href="#" onclick="setSelectOptions(\'db_search\', \'criteriaTables[]\', true); return false;">Select All</a> &nbsp;/&nbsp;<a href="#" onclick="setSelectOptions(\'db_search\', \'criteriaTables[]\', false); return false;">Unselect All</a></td></tr><tr><td class="right">Inside column:</td><td><input type="text" name="criteriaColumnName" size="60"value="" /></td></tr></table></fieldset><fieldset class="tblFooters"><input type="submit" name="submit_search" value="Go" id="buttonGo" /></fieldset></form><!-- These two table-image and table-link elements display the table name in browse search results --><div id="table-info"><a class="item" id="table-link" ></a></div><div id="browse-results"><!-- this browse-results div is used to load the browse and delete results in the db search --></div><br class="clearfloat" /><div id="sqlqueryform"><!-- this sqlqueryform div is used to load the delete form in the db search --></div><!-- toggle query box link--><a id="togglequerybox"></a>',
'<a id="db_search"></a><form id="db_search_form" class="ajax" '
. 'method="post" action="db_search.php" name="db_search"><input type'
. '="hidden" name="db" value="pma" /><input type="hidden" name="lang" '
. 'value="en" /><input type="hidden" name="token" value="token" />'
. '<fieldset><legend>Search in database</legend><table class='
. '"formlayout"><tr><td>Words or values to search for (wildcard: "%"):'
. '</td><td><input type="text" name="criteriaSearchString" size="60" '
. 'value="" /></td></tr><tr><td class="right vtop">Find:</td><td><input '
. 'type="radio" name="criteriaSearchType" id="criteriaSearchType_1" '
. 'value="1" checked="checked" />' . "\n"
. '<label for="criteriaSearchType_1">at least one of the words<span '
. 'class="pma_hint"><img src="themes/dot.gifb_help.png" title="" alt="" '
. '/><span class="hide">Words are separated by a space character (" ").'
. '</span></span></label><br />' . "\n"
. '<input type="radio" name="criteriaSearchType" id="criteriaSearchType'
. '_2" value="2" />' . "\n"
. '<label for="criteriaSearchType_2">all words<span class="pma_hint">'
. '<img src="themes/dot.gifb_help.png" title="" alt="" /><span class'
. '="hide">Words are separated by a space character (" ").</span></span>'
. '</label><br />' . "\n"
. '<input type="radio" name="criteriaSearchType" id="criteriaSearchType'
. '_3" value="3" />' . "\n"
. '<label for="criteriaSearchType_3">the exact phrase</label><br />'
. "\n" . '<input type="radio" name="criteriaSearchType" id="criteria'
. 'SearchType_4" value="4" />' . "\n"
. '<label for="criteriaSearchType_4">as regular expression <a href='
. '"./url.php?url=http%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F5.6%2Fen'
. '%2Fregexp.html&amp;server=0&amp;lang=en&amp;token=token" target='
. '"mysql_doc"><img src="themes/dot.gifb_help.png" title="Documentation"'
. ' alt="Documentation" /></a></label><br />' . "\n"
. '</td></tr><tr><td class="right vtop">Inside tables:</td>'
. '<td rowspan="2"><select name="criteriaTables[]" size="6" '
. 'multiple="multiple"><option value="table1">table1</option>'
. '<option value="table2">table2</option></select></td></tr><tr>'
. '<td class="right vbottom"><a href="#" onclick="setSelectOptions'
. '(\'db_search\', \'criteriaTables[]\', true); return false;">Select '
. 'All</a> &nbsp;/&nbsp;<a href="#" onclick="setSelectOptions'
. '(\'db_search\', \'criteriaTables[]\', false); return false;">Unselect'
. ' All</a></td></tr><tr><td class="right">Inside column:</td><td>'
. '<input type="text" name="criteriaColumnName" size="60"value="" />'
. '</td></tr></table></fieldset><fieldset class="tblFooters"><input '
. 'type="submit" name="submit_search" value="Go" id="buttonGo" />'
. '</fieldset></form><!-- These two table-image and table-link elements '
. 'display the table name in browse search results --><div id="table-'
. 'info"><a class="item" id="table-link" ></a></div><div id="browse-'
. 'results"><!-- this browse-results div is used to load the browse and '
. 'delete results in the db search --></div><br class="clearfloat" />'
. '<div id="sqlqueryform"><!-- this sqlqueryform div is used to load '
. 'the delete form in the db search --></div><!-- toggle query box '
. 'link--><a id="togglequerybox"></a>',
$this->object->getSelectionForm($url_params)
);
}
@ -187,7 +245,14 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase
public function testGetResultDivs()
{
$this->assertEquals(
'<!-- These two table-image and table-link elements display the table name in browse search results --><div id="table-info"><a class="item" id="table-link" ></a></div><div id="browse-results"><!-- this browse-results div is used to load the browse and delete results in the db search --></div><br class="clearfloat" /><div id="sqlqueryform"><!-- this sqlqueryform div is used to load the delete form in the db search --></div><!-- toggle query box link--><a id="togglequerybox"></a>',
'<!-- These two table-image and table-link elements display the '
. 'table name in browse search results --><div id="table-info">'
. '<a class="item" id="table-link" ></a></div><div id="browse-results">'
. '<!-- this browse-results div is used to load the browse and delete '
. 'results in the db search --></div><br class="clearfloat" />'
. '<div id="sqlqueryform"><!-- this sqlqueryform div is used to load the'
. ' delete form in the db search --></div><!-- toggle query box link-->'
. '<a id="togglequerybox"></a>',
$this->_callProtectedFunction(
'_getResultDivs',
array()

View File

@ -618,8 +618,18 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
return array(
array(
'_left',
array('edit_lnk' => null, 'del_lnk' => null),//array('edit_lnk' => 'nn', 'del_lnk' => 'nn'),
'<td class="odd row_0 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox" value="%60cars%60.%60id%60+%3D+3" /><input type="hidden" class="condition_array" value="{&quot;`cars`.`id`&quot;:&quot;= 3&quot;}" /> </td><td class="even row_1 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete1_left" name="rows_to_delete[1]" class="multi_checkbox" value="%60cars%60.%60id%60+%3D+9" /><input type="hidden" class="condition_array" value="{&quot;`cars`.`id`&quot;:&quot;= 9&quot;}" /> </td>'
array('edit_lnk' => null, 'del_lnk' => null),
//array('edit_lnk' => 'nn', 'del_lnk' => 'nn'),
'<td class="odd row_0 vpointer vmarker" class="center"><input type='
. '"checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" '
. 'class="multi_checkbox" value="%60cars%60.%60id%60+%3D+3" />'
. '<input type="hidden" class="condition_array" value="{&quot;'
. '`cars`.`id`&quot;:&quot;= 3&quot;}" /> </td><td class="even '
. 'row_1 vpointer vmarker" class="center"><input type="checkbox" '
. 'id="id_rows_to_delete1_left" name="rows_to_delete[1]" class='
. '"multi_checkbox" value="%60cars%60.%60id%60+%3D+9" /><input '
. 'type="hidden" class="condition_array" value="{&quot;`cars`.'
. '`id`&quot;:&quot;= 9&quot;}" /> </td>'
)
);
}
@ -640,8 +650,18 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
) {
$vertical_display = array(
'row_delete' => array(
'<td class="odd row_0 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[0]" class="multi_checkbox" value="%60cars%60.%60id%60+%3D+3" /><input type="hidden" class="condition_array" value="{&quot;`cars`.`id`&quot;:&quot;= 3&quot;}" /> </td>',
'<td class="even row_1 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete1[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[1]" class="multi_checkbox" value="%60cars%60.%60id%60+%3D+9" /><input type="hidden" class="condition_array" value="{&quot;`cars`.`id`&quot;:&quot;= 9&quot;}" /> </td>'
'<td class="odd row_0 vpointer vmarker" class="center"><input '
. 'type="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" '
. 'name="rows_to_delete[0]" class="multi_checkbox" value="%60cars'
. '%60.%60id%60+%3D+3" /><input type="hidden" class="condition_'
. 'array" value="{&quot;`cars`.`id`&quot;:&quot;= 3&quot;}" /> '
. '</td>',
'<td class="even row_1 vpointer vmarker" class="center"><input '
. 'type="checkbox" id="id_rows_to_delete1[%_PMA_CHECKBOX_DIR_%]" '
. 'name="rows_to_delete[1]" class="multi_checkbox" value="%60cars'
. '%60.%60id%60+%3D+9" /><input type="hidden" class="condition_'
. 'array" value="{&quot;`cars`.`id`&quot;:&quot;= 9&quot;}" /> '
. '</td>'
)
);
@ -735,7 +755,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
{
return array(
array(
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dd1aecb47ef7c081e068e7008b38a5d76&amp;token=d1aecb47ef7c081e068e7008b38a5d76',
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60'
. '.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show='
. 'The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3D'
. 'new%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message'
. '_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_'
. 'structure.php%26token%3Dd1aecb47ef7c081e068e7008b38a5d76&amp;'
. 'token=d1aecb47ef7c081e068e7008b38a5d76',
array(
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -752,7 +778,12 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'[%_PMA_CHECKBOX_DIR_%]',
'odd row_0 vpointer vmarker',
'<td class="odd row_0 vpointer vmarker" class="center"><input type="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
'<td class="odd row_0 vpointer vmarker" class="center"><input type'
. '="checkbox" id="id_rows_to_delete0[%_PMA_CHECKBOX_DIR_%]" name='
. '"rows_to_delete[0]" class="multi_checkbox checkall" value="%60'
. 'new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_'
. 'array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> '
. '</td>'
)
);
}
@ -800,14 +831,25 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
{
return array(
array(
'tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_action=update&amp;token=bbd5003198a3bd856b21d9607d6c6a1e',
'tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60'
. 'customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query='
. 'SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_'
. 'action=update&amp;token=bbd5003198a3bd856b21d9607d6c6a1e',
'odd edit_row_anchor row_0 vpointer vmarker',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt='
. '"Edit" class="icon ic_b_edit" /> Edit</span>',
'`customer`.`id` = 1',
'%60customer%60.%60id%60+%3D+1',
'<td class="odd edit_row_anchor row_0 vpointer vmarker center" ><span class="nowrap">
<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_action=update&amp;token=bbd5003198a3bd856b21d9607d6c6a1e" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
<input type="hidden" class="where_clause" value ="%60customer%60.%60id%60+%3D+1" /></span></td>'
'<td class="odd edit_row_anchor row_0 vpointer vmarker center" >'
. '<span class="nowrap">' . "\n"
. '<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_'
. 'clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;'
. 'sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;'
. 'default_action=update&amp;token=bbd5003198a3bd856b21d9607d6c6a1e"'
. ' ><span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value ="%60customer'
. '%60.%60id%60+%3D+1" /></span></td>'
)
);
}
@ -852,14 +894,25 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
{
return array(
array(
'tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_action=insert&amp;token=f597309d3a066c3c81a6cb015a79636d',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60cust'
. 'omer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query='
. 'SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_'
. 'action=insert&amp;token=f597309d3a066c3c81a6cb015a79636d',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt'
. '="Copy" class="icon ic_b_insrow" /> Copy</span>',
'`customer`.`id` = 1',
'%60customer%60.%60id%60+%3D+1',
'odd row_0 vpointer vmarker',
'<td class="odd row_0 vpointer vmarker center" ><span class="nowrap">
<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;default_action=insert&amp;token=f597309d3a066c3c81a6cb015a79636d" ><span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>
<input type="hidden" class="where_clause" value="%60customer%60.%60id%60+%3D+1" /></span></td>'
'<td class="odd row_0 vpointer vmarker center" ><span class='
. '"nowrap">' . "\n"
. '<a href="tbl_change.php?db=Data&amp;table=customer&amp;where_'
. 'clause=%60customer%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;'
. 'sql_query=SELECT+%2A+FROM+%60customer%60&amp;goto=sql.php&amp;'
. 'default_action=insert&amp;token=f597309d3a066c3c81a6cb015a79636d"'
. ' ><span class="nowrap"><img src="themes/dot.gif" title="Copy" '
. 'alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value="%60customer%60'
. '.%60id%60+%3D+1" /></span></td>'
)
);
}
@ -904,13 +957,30 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
{
return array(
array(
'sql.php?db=Data&amp;table=customer&amp;sql_query=DELETE+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Df597309d3a066c3c81a6cb015a79636d&amp;token=f597309d3a066c3c81a6cb015a79636d',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'sql.php?db=Data&amp;table=customer&amp;sql_query=DELETE+FROM+%60'
. 'Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&amp;'
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb'
. '%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2BFROM'
. '%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen'
. '%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Df597309d3a066c3'
. 'c81a6cb015a79636d&amp;token=f597309d3a066c3c81a6cb015a79636d',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1',
'odd row_0 vpointer vmarker',
'<td class="odd row_0 vpointer vmarker center" >
<a href="sql.php?db=Data&amp;table=customer&amp;sql_query=DELETE+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Df597309d3a066c3c81a6cb015a79636d&amp;token=f597309d3a066c3c81a6cb015a79636d" class="delete_row"><span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span></a>
<div class="hide">DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1</div></td>'
'<td class="odd row_0 vpointer vmarker center" >' . "\n"
. '<a href="sql.php?db=Data&amp;table=customer&amp;sql_query=DELETE'
. '+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D'
. '+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php'
. '%3Fdb%3DData%26table%3Dcustomer%26sql_query%3DSELECT%2B%252A%2B'
. 'FROM%2B%2560customer%2560%26message_to_show%3DThe%2Brow%2Bhas%2B'
. 'been%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Df597309d3a06'
. '6c3c81a6cb015a79636d&amp;token=f597309d3a066c3c81a6cb015a79636d" '
. 'class="delete_row"><span class="nowrap"><img src="themes/dot.'
. 'gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> '
. 'Delete</span></a>' . "\n"
. '<div class="hide">DELETE FROM `Data`.`customer` WHERE '
. '`customer`.`id` = 1</div></td>'
)
);
}
@ -955,7 +1025,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
return array(
array(
PMA_DisplayResults::POSITION_LEFT,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data'
. '%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show='
. 'The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3D'
. 'new%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26'
. 'message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3D'
. 'tbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8'
. '&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
array(
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -974,24 +1050,67 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
),
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'l',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.'
. '%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+'
. 'FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;'
. 'token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.'
. '%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+'
. 'FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;'
. 'token=ae4c6d18375f446dfa068420c1f6a4e8',
'edit_row_anchor',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" '
. 'alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td><td class="edit_row_anchor center" ><span class="nowrap">
<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center" ><span class="nowrap">
<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>
<input type="hidden" class="where_clause" value="%60new%60.%60id%60+%3D+1" /></span></td><td class="center" >
<a href="sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" class="delete_row"><span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span></a>
<div class="hide">DELETE FROM `data`.`new` WHERE `new`.`id` = 1</div></td>'
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_'
. 'left" name="rows_to_delete[0]" class="multi_checkbox checkall" '
. 'value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class='
. '"condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;'
. '}" /> </td><td class="edit_row_anchor center" ><span class='
. '"nowrap">' . "\n"
. '<a href="tbl_change.php?db=data&amp;table=new&amp;where_'
. 'clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;'
. 'sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default'
. '_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" >'
. '<span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value ="%60new%60.%60'
. 'id%60+%3D+1" /></span></td><td class="center" ><span class'
. '="nowrap">' . "\n"
. '<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause'
. '=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query='
. 'SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action='
. 'insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class'
. '="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" '
. 'class="icon ic_b_insrow" /> Copy</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value="%60new%60.%60id'
. '%60+%3D+1" /></span></td><td class="center" >' . "\n"
. '<a href="sql.php?db=data&amp;table=new&amp;sql_query=DELETE+'
. 'FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;'
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3F'
. 'db%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B'
. '%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2B'
. 'deleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446d'
. 'fa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" '
. 'class="delete_row"><span class="nowrap"><img src="themes/dot.'
. 'gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> '
. 'Delete</span></a>' . "\n"
. '<div class="hide">DELETE FROM `data`.`new` WHERE `new`.`id` = 1'
. '</div></td>'
),
array(
PMA_DisplayResults::POSITION_RIGHT,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60'
. '.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show='
. 'The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3D'
. 'new%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message'
. '_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_'
. 'structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;'
. 'token=ae4c6d18375f446dfa068420c1f6a4e8',
array(
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -1010,24 +1129,65 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
),
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'l',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.'
. '%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+'
. 'FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;'
. 'token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.'
. '%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+'
. 'FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;'
. 'token=ae4c6d18375f446dfa068420c1f6a4e8',
'edit_row_anchor',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" '
. 'alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'<td class="center" >
<a href="sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" class="delete_row"><span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span></a>
<div class="hide">DELETE FROM `data`.`new` WHERE `new`.`id` = 1</div></td><td class="center" ><span class="nowrap">
<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span></a>
<input type="hidden" class="where_clause" value="%60new%60.%60id%60+%3D+1" /></span></td><td class="edit_row_anchor center" ><span class="nowrap">
<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span></a>
<input type="hidden" class="where_clause" value ="%60new%60.%60id%60+%3D+1" /></span></td><td class="center"><input type="checkbox" id="id_rows_to_delete0_right" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
'<td class="center" >' . "\n"
. '<a href="sql.php?db=data&amp;table=new&amp;sql_query=DELETE+'
. 'FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;'
. 'message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb'
. '%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%25'
. '60new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted'
. '%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c'
. '1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" class="delete'
. '_row"><span class="nowrap"><img src="themes/dot.gif" title='
. '"Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span></a>'
. "\n" . '<div class="hide">DELETE FROM `data`.`new` WHERE `new`.'
. '`id` = 1</div></td><td class="center" ><span class="nowrap">'
. "\n" . '<a href="tbl_change.php?db=data&amp;table=new&amp;where_'
. 'clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_'
. 'query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_'
. 'action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span '
. 'class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" '
. 'class="icon ic_b_insrow" /> Copy</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value="%60new%60.%60id'
. '%60+%3D+1" /></span></td><td class="edit_row_anchor center" >'
. '<span class="nowrap">' . "\n"
. '<a href="tbl_change.php?db=data&amp;table=new&amp;where_clause'
. '=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query='
. 'SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action='
. 'update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8" ><span class='
. '"nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class'
. '="icon ic_b_edit" /> Edit</span></a>' . "\n"
. '<input type="hidden" class="where_clause" value ="%60new%60.%60'
. 'id%60+%3D+1" /></span></td><td class="center"><input type='
. '"checkbox" id="id_rows_to_delete0_right" name="rows_to_delete'
. '[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60'
. '+%3D+1" /><input type="hidden" class="condition_array" value="'
. '{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
),
array(
PMA_DisplayResults::POSITION_NONE,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.'
. '%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+'
. 'row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew'
. '%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_'
. 'to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure'
. '.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
array(
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -1046,14 +1206,27 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
),
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'l',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60'
. 'id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+'
. '%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60'
. 'id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+'
. '%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
'edit_row_anchor',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" '
. 'alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
'<td class="center"><input type="checkbox" id="id_rows_to_'
. 'delete0_left" name="rows_to_delete[0]" class="multi_checkbox '
. 'checkall" value="%60new%60.%60id%60+%3D+1" /><input type='
. '"hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:'
. '&quot;= 1&quot;}" /> </td>'
),
);
}
@ -1129,7 +1302,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
return array(
array(
PMA_DisplayResults::POSITION_NONE,
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'sql.php?db=data&amp;table=new&amp;sql_query=DELETE+FROM+%60data%60.'
. '%60new%60+WHERE+%60new%60.%60id%60+%3D+1&amp;message_to_show=The+'
. 'row+has+been+deleted&amp;goto=sql.php%3Fdb%3Ddata%26table%3Dnew'
. '%26sql_query%3DSELECT%2B%252A%2BFROM%2B%2560new%2560%26message_'
. 'to_show%3DThe%2Brow%2Bhas%2Bbeen%2Bdeleted%26goto%3Dtbl_structure'
. '.php%26token%3Dae4c6d18375f446dfa068420c1f6a4e8&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
array(
'edit_lnk' => 'ur',
'del_lnk' => 'dr',
@ -1148,14 +1327,27 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
),
'DELETE FROM `data`.`new` WHERE `new`.`id` = 1',
'l',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token=ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60'
. 'id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+'
. '%60new%60&amp;goto=sql.php&amp;default_action=update&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
'tbl_change.php?db=data&amp;table=new&amp;where_clause=%60new%60.%60'
. 'id%60+%3D+1&amp;clause_is_unique=1&amp;sql_query=SELECT+%2A+FROM+'
. '%60new%60&amp;goto=sql.php&amp;default_action=insert&amp;token='
. 'ae4c6d18375f446dfa068420c1f6a4e8',
'edit_row_anchor',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" alt="Delete" class="icon ic_b_drop" /> Delete</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Edit" '
. 'alt="Edit" class="icon ic_b_edit" /> Edit</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Copy" '
. 'alt="Copy" class="icon ic_b_insrow" /> Copy</span>',
'<span class="nowrap"><img src="themes/dot.gif" title="Delete" '
. 'alt="Delete" class="icon ic_b_drop" /> Delete</span>',
null,
'<td class="center"><input type="checkbox" id="id_rows_to_delete0_left" name="rows_to_delete[0]" class="multi_checkbox checkall" value="%60new%60.%60id%60+%3D+1" /><input type="hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:&quot;= 1&quot;}" /> </td>'
'<td class="center"><input type="checkbox" id="id_rows_to_'
. 'delete0_left" name="rows_to_delete[0]" class="multi_checkbox '
. 'checkall" value="%60new%60.%60id%60+%3D+1" /><input type='
. '"hidden" class="condition_array" value="{&quot;`new`.`id`&quot;:'
. '&quot;= 1&quot;}" /> </td>'
)
);
}
@ -1220,7 +1412,8 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'information_schema' => array(
'processlist' => array(
'info' => array(
'libraries/plugins/transformations/Text_Plain_Formatted.class.php',
'libraries/plugins/transformations/Text_Plain_'
. 'Formatted.class.php',
'Text_Plain_Formatted',
'Text_Plain'
)
@ -1237,7 +1430,8 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'information_schema' => array(
'processlist' => array(
'info' => array(
'libraries/plugins/transformations/Text_Plain_Formatted.class.php',
'libraries/plugins/transformations/Text_Plain_'
. 'Formatted.class.php',
'Text_Plain_Formatted',
'Text_Plain'
)
@ -1361,7 +1555,9 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'routine_type' => 'FUNCTION'
),
'routine_name',
'db_routines.php?item_name=circumference&amp;db=data&amp;execute_dialog=1&amp;item_type=FUNCTION&amp;server=0&amp;lang=en&amp;token=token'
'db_routines.php?item_name=circumference&amp;db=data&amp;execute_'
. 'dialog=1&amp;item_type=FUNCTION&amp;server=0&amp;lang=en&amp;'
. 'token=token'
),
array(
'information_schema',
@ -1373,7 +1569,8 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'routine_type' => 'PROCEDURE'
),
'routine_name',
'db_routines.php?item_name=area&amp;db=data&amp;execute_routine=1&amp;item_type=PROCEDURE&amp;server=0&amp;lang=en&amp;token=token'
'db_routines.php?item_name=area&amp;db=data&amp;execute_routine=1'
. '&amp;item_type=PROCEDURE&amp;server=0&amp;lang=en&amp;token=token'
),
array(
'information_schema',
@ -1384,7 +1581,9 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'table_name' => 'CHARACTER_SETS'
),
'column_name',
'index.php?sql_query=SELECT+%60CHARACTER_SET_NAME%60+FROM+%60information_schema%60.%60CHARACTER_SETS%60&amp;db=information_schema&amp;test_name=value&amp;server=0&amp;lang=en&amp;token=token'
'index.php?sql_query=SELECT+%60CHARACTER_SET_NAME%60+FROM+%60info'
. 'rmation_schema%60.%60CHARACTER_SETS%60&amp;db=information_schema'
. '&amp;test_name=value&amp;server=0&amp;lang=en&amp;token=token'
)
);
}
@ -1545,8 +1744,16 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase
'user',
'tbl_structure.php',
'SELECT * FROM `user`',
'
<td><form action="sql.php" method="post"><input type="hidden" name="db" value="mysql" /><input type="hidden" name="table" value="user" /><input type="hidden" name="lang" value="en" /><input type="hidden" name="token" value="token" /><input type="hidden" name="sql_query" value="SELECT * FROM `user`" /><input type="hidden" name="pos" value="0" /><input type="hidden" name="session_max_rows" value="all" /><input type="hidden" name="goto" value="tbl_structure.php" /><input type="submit" name="navig" value="Show all" /></form></td>'
"\n"
. '<td><form action="sql.php" method="post"><input type="hidden" '
. 'name="db" value="mysql" /><input type="hidden" name="table" '
. 'value="user" /><input type="hidden" name="lang" value="en" />'
. '<input type="hidden" name="token" value="token" /><input type="'
. 'hidden" name="sql_query" value="SELECT * FROM `user`" /><input '
. 'type="hidden" name="pos" value="0" /><input type="hidden" name='
. '"session_max_rows" value="all" /><input type="hidden" name='
. '"goto" value="tbl_structure.php" /><input type="submit" name='
. '"navig" value="Show all" /></form></td>'
)
);
}

View File

@ -12,8 +12,18 @@
require_once 'libraries/Util.class.php';
require_once 'libraries/File.class.php';
/**
* tests for PMA_File class
*
* @package PhpMyAdmin-test
*/
class PMA_File_Test extends PHPUnit_Framework_TestCase
{
/**
* Setup function for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['cfg']['BZipDump'] = true;
@ -23,6 +33,12 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase
}
/**
* Test for PMA_File::getCompression
*
* @param string $file file string
* @param string $mime expected mime
*
* @return void
* @dataProvider compressedFiles
*/
public function testMIME($file, $mime)
@ -32,6 +48,12 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase
}
/**
* Test for PMA_File::getNextChunk
*
* @param string $file file string
* @param string $mime expected mime
*
* @return void
* @dataProvider compressedFiles
*/
public function testContent($file, $mime)
@ -48,6 +70,12 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase
}
/**
* Test for PMA_File::getContent
*
* @param string $file file string
* @param string $mime expected mime
*
* @return void
* @dataProvider compressedFiles
*/
public function testBinaryContent($file, $mime)
@ -57,6 +85,11 @@ class PMA_File_Test extends PHPUnit_Framework_TestCase
$this->assertEquals($data, $file->getContent());
}
/**
* Data provider for tests
*
* @return array Test data
*/
public function compressedFiles()
{
return array(

View File

@ -123,7 +123,8 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
);
$this->assertRegExp(
'/<div id="session_debug">2 queries executed 2 times in 2.7 seconds<pre>/',
'/<div id="session_debug">2 queries executed 2 times in 2.7 seconds'
. '<pre>/',
$this->_callPrivateFunction(
'_getDebugMessage',
array()
@ -143,7 +144,10 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['ServerDefault'] = 1;
$this->assertEquals(
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank">Open new phpMyAdmin window</a></div>',
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;'
. 'table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection='
. 'utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" '
. 'target="_blank">Open new phpMyAdmin window</a></div>',
$this->_callPrivateFunction(
'_getSelfLink',
array(
@ -167,7 +171,11 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
$GLOBALS['pmaThemeImage'] = 'image';
$this->assertEquals(
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" target="_blank"><img src="imagewindow-new.png" title="Open new phpMyAdmin window" alt="Open new phpMyAdmin window" /></a></div>',
'<div id="selflink" class="print_ignore"><a href="index.php?db=&amp;'
. 'table=&amp;server=1&amp;target=&amp;lang=en&amp;collation_connection='
. 'utf8_general_ci&amp;token=token" title="Open new phpMyAdmin window" '
. 'target="_blank"><img src="imagewindow-new.png" title="Open new '
. 'phpMyAdmin window" alt="Open new phpMyAdmin window" /></a></div>',
$this->_callPrivateFunction(
'_getSelfLink',
array(

View File

@ -13,8 +13,18 @@ require_once 'libraries/Util.class.php';
require_once 'libraries/List_Database.class.php';
require_once 'libraries/relation.lib.php';
/**
* tests for PMA_List_Database class
*
* @package PhpMyAdmin-test
*/
class PMA_List_Database_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['cfg']['Server']['only_db'] = array('single\\_db');
@ -37,28 +47,51 @@ class PMA_List_Database_Test extends PHPUnit_Framework_TestCase
return $method->invokeArgs($this->object, $params);
}
/**
* Test for PMA_List_Database::getEmpty
*
* @return void
*/
public function testEmpty()
{
$arr = new PMA_List_Database;
$this->assertEquals('', $arr->getEmpty());
}
/**
* Test for PMA_List_Database::getSingleItem
*
* @return void
*/
public function testSingle()
{
$arr = new PMA_List_Database;
$this->assertEquals('single_db', $arr->getSingleItem());
}
/**
* Test for PMA_List_Database::exists
*
* @return void
*/
public function testExists()
{
$arr = new PMA_List_Database;
$this->assertEquals(true, $arr->exists('single_db'));
}
/**
* Test for PMA_List_Database::getHtmlOptions
*
* @return void
*/
public function testHtmlOptions()
{
$arr = new PMA_List_Database;
$this->assertEquals('<option value="single_db">single_db</option>' . "\n", $arr->getHtmlOptions());
$this->assertEquals(
'<option value="single_db">single_db</option>' . "\n",
$arr->getHtmlOptions()
);
}
/**

View File

@ -16,6 +16,11 @@ require_once 'libraries/Message.class.php';
require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/Theme.class.php';
/**
* Test for PMA_Message class
*
* @package PhpMyAdmin-test
*/
class PMA_Message_Test extends PHPUnit_Framework_TestCase
{
/**
@ -323,6 +328,11 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
);
}
/**
* Data provider for testDecodeBB
*
* @return array Test data
*/
public function decodeBBDataProvider()
{
return array(
@ -344,7 +354,8 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
),
array(
'[a@http://foo.bar/@Documentation]link[/a]',
'<a href="./url.php?url=http%3A%2F%2Ffoo.bar%2F&amp;lang=en&amp;token=token" target="Documentation">link</a>'
'<a href="./url.php?url=http%3A%2F%2Ffoo.bar%2F&amp;lang=en&amp;'
. 'token=token" target="Documentation">link</a>'
),
array(
'[a@./non-existing@Documentation]link[/a]',
@ -352,7 +363,9 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
),
array(
'[doc@foo]link[/doc]',
'<a href="./url.php?url=http%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Fsetup.html%23foo&amp;lang=en&amp;token=token" target="documentation">link</a>'
'<a href="./url.php?url=http%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2F'
. 'latest%2Fsetup.html%23foo&amp;lang=en&amp;token=token" '
. 'target="documentation">link</a>'
),
);
}
@ -476,7 +489,9 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
{
$this->object->setMessage('[kbd]test[/kbd] [doc@cfg_Example]test[/doc]');
$this->assertEquals(
'<kbd>test</kbd> <a href="./url.php?url=http%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Fcfg.html%23cfg_Example&amp;lang=en&amp;token=token" target="documentation">test</a>',
'<kbd>test</kbd> <a href="./url.php?url=http%3A%2F%2Fdocs.phpmyadmin.'
. 'net%2Fen%2Flatest%2Fcfg.html%23cfg_Example&amp;lang=en&amp;token='
. 'token" target="documentation">test</a>',
$this->object->getMessage()
);
}
@ -505,7 +520,10 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
$this->assertFalse($this->object->isDisplayed());
$this->object->setMessage('Test Message');
$this->expectOutputString('<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> Test Message</div>');
$this->expectOutputString(
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> '
. 'Test Message</div>'
);
$this->object->display();
$this->assertTrue($this->object->isDisplayed());
@ -520,7 +538,8 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
{
$this->object->setMessage('Test Message');
$this->assertEquals(
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> Test Message</div>',
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> '
. 'Test Message</div>',
$this->object->getDisplay()
);
}
@ -537,12 +556,29 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
$this->assertTrue($this->object->isDisplayed(false));
}
/**
* Data provider for testAffectedRows
*
* @return array Test-data
*/
public function providerAffectedRows()
{
return array(
array(1, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 1 row affected.</div>'),
array(2, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 2 rows affected.</div>'),
array(10000, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 10000 rows affected.</div>'),
array(
1,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 1 row affected.</div>'
),
array(
2,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 2 rows affected.</div>'
),
array(
10000,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 10000 rows affected.</div>'
)
);
}
@ -565,12 +601,29 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
$this->object->display();
}
/**
* Data provider for testInsertedRows
*
* @return array Test-data
*/
public function providerInsertedRows()
{
return array(
array(1, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 1 row inserted.</div>'),
array(2, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 2 rows inserted.</div>'),
array(100000, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 100000 rows inserted.</div>'),
array(
1,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 1 row inserted.</div>'
),
array(
2,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 2 rows inserted.</div>'
),
array(
100000,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 100000 rows inserted.</div>'
)
);
}
@ -593,12 +646,29 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
$this->object->display();
}
/**
* Data provider for testDeletedRows
*
* @return array Test-data
*/
public function providerDeletedRows()
{
return array(
array(1, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 1 row deleted.</div>'),
array(2, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 2 rows deleted.</div>'),
array(500000, '<div class="notice"><img src="theme/s_notice.png" title="" alt="" /> 500000 rows deleted.</div>'),
array(
1,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 1 row deleted.</div>'
),
array(
2,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 2 rows deleted.</div>'
),
array(
500000,
'<div class="notice"><img src="theme/s_notice.png" title="" alt="" '
. '/> 500000 rows deleted.</div>'
)
);
}

View File

@ -15,15 +15,29 @@ require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/core.lib.php';
require_once 'libraries/Config.class.php';
/**
* tests for PMA_PDF class
*
* @package PhpMyAdmin-test
*/
class PMA_PDF_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['PMA_Config'] = new PMA_Config();
$GLOBALS['PMA_Config']->enableBc();
}
/**
* Test for PMA_PDF::getPDFData
*
* @group large
* @return void
*/
public function testBasic()
{
@ -32,7 +46,10 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase
}
/**
* Test for PMA_PDF::getPDFData
*
* @group large
* @return void
*/
public function testAlias()
{
@ -42,7 +59,10 @@ class PMA_PDF_Test extends PHPUnit_Framework_TestCase
}
/**
* Test for PMA_PDF::getPDFData
*
* @group large
* @return void
*/
public function testDocument()
{

View File

@ -12,7 +12,11 @@
require_once 'libraries/Scripts.class.php';
require_once 'libraries/js_escape.lib.php';
/**
* Tests for Script.class.php
*
* @package PhpMyAdmin-test
*/
class PMA_Scripts_Test extends PHPUnit_Framework_TestCase
{
/**
@ -73,7 +77,8 @@ class PMA_Scripts_Test extends PHPUnit_Framework_TestCase
public function testIncludeFile()
{
$this->assertEquals(
'<script type="text/javascript" src="js/get_scripts.js.php?scripts[]=common.js"></script>',
'<script type="text/javascript" src="js/get_scripts.js.php?scripts[]'
. '=common.js"></script>',
$this->_callPrivateFunction(
'_includeFiles',
array(
@ -101,11 +106,13 @@ class PMA_Scripts_Test extends PHPUnit_Framework_TestCase
$this->object->addEvent('onClick', 'doSomething');
$this->assertRegExp(
'@<script type="text/javascript" src="js/get_scripts.js.php\\?scripts\\[\\]=common.js"></script><script type="text/javascript">// <!\\[CDATA\\[
AJAX.scriptHandler.add\\("common.js",1\\);
\\$\\(function\\(\\) \\{AJAX.fireOnload\\("common.js"\\);\\}\\);
\\$\\(window\\).bind\\(\'onClick\', doSomething\\);
// ]]></script>@',
'@<script type="text/javascript" src="js/get_scripts.js.php\\?scripts'
. '\\[\\]=common.js"></script><script type="text/javascript">// '
. '<!\\[CDATA\\[' . "\n"
. 'AJAX.scriptHandler.add\\("common.js",1\\);' . "\n"
. '\\$\\(function\\(\\) \\{AJAX.fireOnload\\("common.js"\\);\\}\\);'
. "\n" . '\\$\\(window\\).bind\\(\'onClick\', doSomething\\);' . "\n"
. '// ]]></script>@',
$this->object->getDisplay()
);
@ -138,8 +145,9 @@ $(function() {});
*/
public function testGetFiles()
{
$this->object->addFile('codemirror/lib/codemirror.js'); // codemirror's onload event is blacklisted
// codemirror's onload event is blacklisted
$this->object->addFile('codemirror/lib/codemirror.js');
$this->object->addFile('common.js');
$this->assertEquals(
array(

View File

@ -107,7 +107,8 @@ class PMA_TableReplaceSearchTest extends PHPUnit_Framework_TestCase
$ret
);
$this->assertContains(
'<input type="hidden" name="replaceWith"' . ' value="' . $replaceWith . '" />',
'<input type="hidden" name="replaceWith"' . ' value="'
. $replaceWith . '" />',
$ret
);

View File

@ -89,7 +89,8 @@ class PMA_TableSearch_Test extends PHPUnit_Framework_TestCase
`query` text COLLATE utf8_bin NOT NULL,
PRIMARY KEY (`id`),
KEY `foreign_field` (`foreign_db`,`foreign_table`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Bookmarks'";
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_bin "
. "COMMENT='Bookmarks'";
$dbi->expects($this->any())->method('fetchValue')
->will($this->returnValue($show_create_table));
@ -357,7 +358,9 @@ class PMA_TableSearch_Test extends PHPUnit_Framework_TestCase
$tableSearch = new PMA_TableSearch("PMA", "PMA_BookMark", "zoom");
$sql = $tableSearch->buildSqlQuery();
$result = "SELECT DISTINCT * FROM `PMA` WHERE name='pma' ORDER BY `name` asc";
$result = "SELECT DISTINCT * FROM `PMA` WHERE name='pma' "
. "ORDER BY `name` asc";
$this->assertEquals(
$result,
$sql
@ -418,10 +421,10 @@ class PMA_TableSearch_Test extends PHPUnit_Framework_TestCase
);
$sql = $tableSearch->buildSqlQuery();
$result = "SELECT DISTINCT * FROM `PMA` WHERE `name` != 'value1' AND `id` > value2 "
. "AND `index` IS NULL AND `index2` LIKE '%value4%' AND `index3` REGEXP ^value5$ "
. "AND `index4` IN (value6) AND `index5` BETWEEN value7 "
. "AND value8 ORDER BY `name` asc";
$result = "SELECT DISTINCT * FROM `PMA` WHERE `name` != 'value1'"
. " AND `id` > value2 AND `index` IS NULL AND `index2` LIKE '%value4%'"
. " AND `index3` REGEXP ^value5$ AND `index4` IN (value6) AND `index5`"
. " BETWEEN value7 AND value8 ORDER BY `name` asc";
$this->assertEquals(
$result,
$sql

View File

@ -806,7 +806,8 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
$expect,
$return
);
$sql_query = "INSERT INTO `PMA_new`.`PMA_BookMark_new` SELECT * FROM `PMA`.`PMA_BookMark`";
$sql_query = "INSERT INTO `PMA_new`.`PMA_BookMark_new` SELECT * FROM "
. "`PMA`.`PMA_BookMark`";
$this->assertContains(
$sql_query,
$GLOBALS['sql_query']
@ -828,7 +829,8 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
$expect,
$return
);
$sql_query = "INSERT INTO `PMA_new`.`PMA_BookMark_new` SELECT * FROM `PMA`.`PMA_BookMark`;";
$sql_query = "INSERT INTO `PMA_new`.`PMA_BookMark_new` SELECT * FROM "
. "`PMA`.`PMA_BookMark`;";
$this->assertContains(
$sql_query,
$GLOBALS['sql_query']
@ -842,7 +844,6 @@ class PMA_Table_Test extends PHPUnit_Framework_TestCase
}
/**
*
* Tests behaviour of PMA_Table class with Runkit and PMA_Drizzle = false
*
* @package PhpMyAdmin-test
@ -872,13 +873,17 @@ class PMA_Table_Runkit_Test extends PMA_Table_Test
}
}
//mock PMA
/**
* DataBasePMAMock Class
*/
Class DataBasePMAMock
{
var $databases;
}
//mock $GLOBALS['pma']->databases
/**
* DataBasePMAMock Class
*/
Class DataBaseMock
{
function exists($name)

View File

@ -17,8 +17,18 @@ require_once 'libraries/Theme_Manager.class.php';
require_once 'libraries/Config.class.php';
require_once 'libraries/core.lib.php';
/**
* tests for PMA_Theme_Manager class
*
* @package PhpMyAdmin-test
*/
class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['cfg']['ThemePath'] = './themes';
@ -30,12 +40,22 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase
$GLOBALS['collation_connection'] = 'utf8_general_ci';
}
/**
* Test for PMA_Theme_Manager::getThemeCookieName
*
* @return void
*/
public function testCookieName()
{
$tm = new PMA_Theme_Manager();
$this->assertEquals('pma_theme', $tm->getThemeCookieName());
}
/**
* Test for PMA_Theme_Manager::getThemeCookieName
*
* @return void
*/
public function testPerServerCookieName()
{
$tm = new PMA_Theme_Manager();
@ -43,6 +63,11 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase
$this->assertEquals('pma_theme-99', $tm->getThemeCookieName());
}
/**
* Test for PMA_Theme_Manager::getHtmlSelectBox
*
* @return void
*/
public function testHtmlSelectBox()
{
$tm = new PMA_Theme_Manager();
@ -104,7 +129,17 @@ class PMA_Theme_Manager_Test extends PHPUnit_Framework_TestCase
{
$tm = new PMA_Theme_Manager();
$this->assertEquals(
'<div class="theme_preview"><h2>Original (2.9) </h2><p><a class="take_theme" name="original" href="index.php?set_theme=original&amp;server=99&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token"><img src="./themes/original/screen.png" border="1" alt="Original" title="Original" /><br />[ <strong>take it</strong> ]</a></p></div><div class="theme_preview"><h2>pmahomme (1.1) </h2><p><a class="take_theme" name="pmahomme" href="index.php?set_theme=pmahomme&amp;server=99&amp;lang=en&amp;collation_connection=utf8_general_ci&amp;token=token"><img src="./themes/pmahomme/screen.png" border="1" alt="pmahomme" title="pmahomme" /><br />[ <strong>take it</strong> ]</a></p></div>',
'<div class="theme_preview"><h2>Original (2.9) </h2><p><a class='
. '"take_theme" name="original" href="index.php?set_theme=original'
. '&amp;server=99&amp;lang=en&amp;collation_connection=utf8_general_ci'
. '&amp;token=token"><img src="./themes/original/screen.png" border="1" '
. 'alt="Original" title="Original" /><br />[ <strong>take it</strong> ]'
. '</a></p></div><div class="theme_preview"><h2>pmahomme (1.1) </h2><p>'
. '<a class="take_theme" name="pmahomme" href="index.php?set_theme='
. 'pmahomme&amp;server=99&amp;lang=en&amp;collation_connection=utf8_'
. 'general_ci&amp;token=token"><img src="./themes/pmahomme/screen.png" '
. 'border="1" alt="pmahomme" title="pmahomme" /><br />[ <strong>take it'
. '</strong> ]</a></p></div>',
$tm->getPrintPreviews()
);
}

View File

@ -1,6 +1,10 @@
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* Test class for PMA_Theme.
*
* @package PhpMyAdmin-test
*/
require_once 'libraries/Theme.class.php';
require_once 'libraries/core.lib.php';
require_once 'libraries/Util.class.php';
@ -49,12 +53,22 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
{
}
/**
* Test for PMA_Theme::loadInfo
*
* @return void
*/
public function testCheckImgPathNotExisted()
{
$this->object->setPath('path/to/nowhere');
$this->assertFalse($this->object->loadInfo());
}
/**
* Test for PMA_Theme::loadInfo
*
* @return void
*/
public function testCheckImgPathIncorrect()
{
$this->object->setPath('./test/classes/_data/incorrect_theme');
@ -64,6 +78,11 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
);
}
/**
* Test for PMA_Theme::getName, getVersion
*
* @return void
*/
public function testCheckImgPathFull()
{
$this->object->setPath('./test/classes/_data/gen_version_info');
@ -72,6 +91,11 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
$this->assertEquals('2.0.3', $this->object->getVersion());
}
/**
* Test for PMA_Theme::loadInfo
*
* @return void
*/
public function testLoadInfo()
{
$this->object->setPath('./themes/original');
@ -89,21 +113,31 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
$this->assertEquals('Original', $this->object->getName());
}
/**
* Test for PMA_Theme::load
*
* @return void
*/
public function testLoad()
{
$newTheme = PMA_Theme::load('./themes/original');
$this->assertNotNull($newTheme);
}
/**
* Test for PMA_Theme::load
*
* @return void
*/
public function testLoadNotExisted()
{
$this->assertFalse(PMA_Theme::load('/path/to/nowhere'));
}
/**
*
* Test fir PMA_Theme::checkImgPath
*
* @return void
*
* @expectedException PHPUnit_Framework_Error
*/
public function testCheckImgPathBad()
@ -114,12 +148,22 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
$this->assertFalse($this->object->checkImgPath());
}
/**
* Test for PMA_Theme::checkImgPath
*
* @return void
*/
public function testCheckImgPath()
{
$this->object->setPath('./themes/original');
$this->assertTrue($this->object->checkImgPath());
}
/**
* Test for PMA_Theme::checkImgPath
*
* @return void
*/
public function testCheckImgPathGlobals()
{
$this->object->setPath('/this/is/wrong/path');
@ -128,9 +172,9 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* Test for PMA_Theme::checkImgPath
*
* @return void
*
* @expectedException PHPUnit_Framework_Error
*/
public function testCheckImgPathGlobalsWrongPath()
@ -145,7 +189,8 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* Test for PMA_Theme::getPath
*
* @return void
*
* @covers PMA_Theme::setPath
@ -159,13 +204,19 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
$this->assertEquals('./themes/original', $this->object->getPath());
}
/**
* Test for PMA_Theme::loadInfo
*
* @return void
*/
public function testGetLayoutFile()
{
$this->assertContains('layout.inc.php', $this->object->getLayoutFile());
}
/**
*
* Test for PMA_Theme::checkVersion
*
* @return void
*
* @depends testLoadInfo
@ -186,7 +237,8 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* Test for PMA_Theme::getName
*
* @return void
*
* @covers PMA_Theme::getName
@ -201,7 +253,8 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* Test for PMA_Theme::getId
*
* @return void
*
* @covers PMA_Theme::getId
@ -216,7 +269,8 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
}
/**
*
* Test for PMA_Theme::getImgPath
*
* @return void
*
* @covers PMA_Theme::getImgPath
@ -242,7 +296,10 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
{
$this->assertEquals(
$this->object->getPrintPreview(),
'<div class="theme_preview"><h2> (0.0.0.0) </h2><p><a class="take_theme" name="" href="index.php?set_theme=&amp;server=99&amp;lang=en&amp;token=token">No preview available.[ <strong>take it</strong> ]</a></p></div>'
'<div class="theme_preview"><h2> (0.0.0.0) </h2><p><a class="take_'
. 'theme" name="" href="index.php?set_theme=&amp;server=99&amp;lang=en'
. '&amp;token=token">No preview available.[ <strong>take it</strong> ]'
. '</a></p></div>'
);
}
@ -294,13 +351,14 @@ class PMA_ThemeTest extends PHPUnit_Framework_TestCase
{
$this->assertEquals(
$this->object->getCssGradient('12345', '54321'),
'background-image: url(./themes/svg_gradient.php?from=12345&to=54321);
background-size: 100% 100%;
background: -webkit-gradient(linear, left top, left bottom, from(#12345), to(#54321));
background: -webkit-linear-gradient(top, #12345, #54321);
background: -moz-linear-gradient(top, #12345, #54321);
background: -ms-linear-gradient(top, #12345, #54321);
background: -o-linear-gradient(top, #12345, #54321);'
'background-image: url(./themes/svg_gradient.php?from=12345&to=54321);'
. "\n" . 'background-size: 100% 100%;'
. "\n" . 'background: -webkit-gradient(linear, left top, left bottom, '
. 'from(#12345), to(#54321));'
. "\n" . 'background: -webkit-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -moz-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -ms-linear-gradient(top, #12345, #54321);'
. "\n" . 'background: -o-linear-gradient(top, #12345, #54321);'
);
}

View File

@ -14,6 +14,11 @@ require_once 'libraries/php-gettext/gettext.inc';
require_once 'libraries/database_interface.inc.php';
require_once 'libraries/Tracker.class.php';
/**
* Tests for Types.class.php
*
* @package PhpMyAdmin-test
*/
class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
{
/**
@ -24,6 +29,8 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
@ -36,6 +43,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
* @param string $type The data type to get a description.
* @param string $output Expected string
*
* @return void
* @dataProvider providerForTestGetTypeDescription
*/
public function testGetTypeDescription($type, $output)
@ -48,6 +56,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
/**
* Provider for testGetTypeDescription
*
* @return array
*/
public function providerForTestGetTypeDescription()
@ -59,11 +68,14 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
),
array(
'BIGINT',
'An 8-byte integer, range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807'
'An 8-byte integer, range is -9,223,372,036,854,775,808 to 9,223,'
. '372,036,854,775,807'
),
array(
'DECIMAL',
'A fixed-point number (M, D) - the maximum number of digits (M) is 65 (default 10), the maximum number of decimals (D) is 30 (default 0)'
'A fixed-point number (M, D) - the maximum number of digits (M) '
. 'is 65 (default 10), the maximum number of decimals (D) is 30 '
. '(default 0)'
),
array(
'DOUBLE',
@ -87,11 +99,13 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
),
array(
'DATETIME',
'A date and time combination, supported range is 0001-01-01 00:00:0 to 9999-12-31 23:59:59'
'A date and time combination, supported range is 0001-01-01 00:00:0 '
. 'to 9999-12-31 23:59:59'
),
array(
'TIMESTAMP',
'A timestamp, range is \'0001-01-01 00:00:00\' UTC to \'9999-12-31 23:59:59\' UTC; TIMESTAMP(6) can store microseconds'
'A timestamp, range is \'0001-01-01 00:00:00\' UTC to \'9999-12-31 '
. '23:59:59\' UTC; TIMESTAMP(6) can store microseconds'
),
array(
'TIME',
@ -99,19 +113,24 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
),
array(
'VARCHAR',
'A variable-length (0-16,383) string, the effective maximum length is subject to the maximum row size'
'A variable-length (0-16,383) string, the effective maximum length '
. 'is subject to the maximum row size'
),
array(
'TEXT',
'A TEXT column with a maximum length of 65,535 (2^16 - 1) characters, stored with a two-byte prefix indicating the length of the value in bytes'
'A TEXT column with a maximum length of 65,535 (2^16 - 1) characters'
. ', stored with a two-byte prefix indicating the length of the valu'
. 'e in bytes'
),
array(
'VARBINARY',
'A variable-length (0-65,535) string, uses binary collation for all comparisons'
'A variable-length (0-65,535) string, uses binary collation for all '
. 'comparisons'
),
array(
'BLOB',
'A BLOB column with a maximum length of 65,535 (2^16 - 1) bytes, stored with a two-byte prefix indicating the length of the value'
'A BLOB column with a maximum length of 65,535 (2^16 - 1) bytes, '
. 'stored with a two-byte prefix indicating the length of the value'
),
array(
'ENUM',
@ -130,6 +149,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
* @param string $type Type to test
* @param string $output Expected result
*
* @return void
* @dataProvider providerFortTestGetTypeClass
*/
public function testGetTypeClass($type, $output)
@ -140,6 +160,11 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
);
}
/**
* Data provider
*
* @return array Test-data
*/
public function providerFortTestGetTypeClass()
{
return array(
@ -172,6 +197,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
* @param string $class The class to get function list.
* @param array $output Expected result
*
* @return void
* @dataProvider providerFortTestGetFunctionsClass
*/
public function testGetFunctionsClass($class, $output)
@ -185,6 +211,7 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
/**
* Provider for testGetFunctionsClass
*
* @return array
*/
public function providerFortTestGetFunctionsClass()
@ -305,6 +332,8 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
/**
* Test for getAttributes
*
* @return void
*/
public function testGetAttributes()
{
@ -319,6 +348,8 @@ class PMA_Types_Drizzle_Test extends PHPUnit_Framework_TestCase
/**
* Test for getColumns
*
* @return void
*/
public function testGetColumns()
{

View File

@ -117,7 +117,7 @@ class PMA_Util_Test extends PHPUnit_Framework_TestCase
* Test version to int conversion.
*
* @param string $version Version string
* @param int $numberic Integer matching version
* @param int $numeric Integer matching version
*
* @return void
*

View File

@ -374,7 +374,34 @@ class PMA_GIS_GeometryCollectionTest extends PHPUnit_Framework_TestCase
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(35,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(10,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(15,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(45,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(20,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,32)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(30,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(20,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.'
. 'LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326'
. '"), map.getProjectionObject())); bound.extend(new OpenLayer'
. 's.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:43'
. '26"), map.getProjectionObject()));vectorLayer.addFeatures(n'
. 'ew OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygo'
. 'n(new Array(new OpenLayers.Geometry.LinearRing(new Array((n'
. 'ew OpenLayers.Geometry.Point(35,10)).transform(new OpenLaye'
. 'rs.Projection("EPSG:4326"), map.getProjectionObject()), (ne'
. 'w OpenLayers.Geometry.Point(10,20)).transform(new OpenLayer'
. 's.Projection("EPSG:4326"), map.getProjectionObject()), (new'
. ' OpenLayers.Geometry.Point(15,40)).transform(new OpenLayers.'
. 'Projection("EPSG:4326"), map.getProjectionObject()), (new O'
. 'penLayers.Geometry.Point(45,45)).transform(new OpenLayers.P'
. 'rojection("EPSG:4326"), map.getProjectionObject()), (new Op'
. 'enLayers.Geometry.Point(35,10)).transform(new OpenLayers.Pr'
. 'ojection("EPSG:4326"), map.getProjectionObject()))), new Op'
. 'enLayers.Geometry.LinearRing(new Array((new OpenLayers.Geom'
. 'etry.Point(20,30)).transform(new OpenLayers.Projection("EPS'
. 'G:4326"), map.getProjectionObject()), (new OpenLayers.Geome'
. 'try.Point(35,32)).transform(new OpenLayers.Projection("EPSG'
. ':4326"), map.getProjectionObject()), (new OpenLayers.Geomet'
. 'ry.Point(30,20)).transform(new OpenLayers.Projection("EPSG:'
. '4326"), map.getProjectionObject()), (new OpenLayers.Geometry'
. '.Point(20,30)).transform(new OpenLayers.Projection("EPSG:43'
. '26"), map.getProjectionObject()))))), null, {"strokeColor":'
. '"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpac'
. 'ity":0.8,"label":"Ol","fontSize":10}));'
)
);
}

View File

@ -293,7 +293,9 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
'scale' => 2,
'height' => 150
),
'/^(<polyline points="0,218 72,138 114,242 26,198 4,182 46,132 " name="svg" id="svg)(\d+)(" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2"\/>)$/'
'/^(<polyline points="0,218 72,138 114,242 26,198 4,182 46,132 " '
. 'name="svg" id="svg)(\d+)(" class="linestring vector" fill="none" '
. 'stroke="#B02EE0" stroke-width="2"\/>)$/'
)
);
}
@ -341,7 +343,25 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), null, {"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.'
. 'LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.LonLat'
. '(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.get'
. 'ProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feat'
. 'ure.Vector(new OpenLayers.Geometry.LineString(new Array((new Open'
. 'Layers.Geometry.Point(12,35)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geome'
. 'try.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"'
. '), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69'
. ',23)).transform(new OpenLayers.Projection("EPSG:4326"), map.'
. 'getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).'
. 'transform(new OpenLayers.Projection("EPSG:4326"), map.'
. 'getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).'
. 'transform(new OpenLayers.Projection("EPSG:4326"), map.get'
. 'ProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).'
. 'transform(new OpenLayers.Projection("EPSG:4326"), map.'
. 'getProjectionObject()))), null, {"strokeColor":"#B02EE0",'
. '"strokeWidth":2,"label":"Ol","fontSize":10}));'
)
);
}

View File

@ -354,7 +354,11 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
'scale' => 2,
'height' => 150
),
'/^(<polyline points="48,260 70,242 100,138 " name="svg" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><polyline points="48,268 10,242 332,182 " name="svg" class="linestring vector" fill="none" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/>)$/'
'/^(<polyline points="48,260 70,242 100,138 " name="svg" '
. 'class="linestring vector" fill="none" stroke="#B02EE0" '
. 'stroke-width="2" id="svg)(\d+)("\/><polyline points="48,268 10,'
. '242 332,182 " name="svg" class="linestring vector" fill="none" '
. 'stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/>)$/'
)
);
}
@ -402,7 +406,26 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(new Array(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(36,14)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(47,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(62,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), new OpenLayers.Geometry.LineString(new Array((new OpenLayers.Geometry.Point(36,10)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(17,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(178,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.'
. 'LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.LonLat'
. '(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.'
. 'getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.'
. 'Feature.Vector(new OpenLayers.Geometry.MultiLineString(new Arr'
. 'ay(new OpenLayers.Geometry.LineString(new Array((new OpenLayers.'
. 'Geometry.Point(36,14)).transform(new OpenLayers.Projection("EPSG:'
. '4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Po'
. 'int(47,23)).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()), (new OpenLayers.Geometry.Point(62,75)'
. ').transform(new OpenLayers.Projection("EPSG:4326"), map.getProjec'
. 'tionObject()))), new OpenLayers.Geometry.LineString(new Array(('
. 'new OpenLayers.Geometry.Point(36,10)).transform(new OpenLayers.'
. 'Projection("EPSG:4326"), map.getProjectionObject()), (new Open'
. 'Layers.Geometry.Point(17,23)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geo'
. 'metry.Point(178,53)).transform(new OpenLayers.Projection("EPSG:'
. '4326"), map.getProjectionObject()))))), null, {"strokeColor":"'
. '#B02EE0","strokeWidth":2,"label":"Ol","fontSize":10}));'
)
);
}

View File

@ -298,7 +298,17 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
'scale' => 2,
'height' => 150
),
'/^(<circle cx="72" cy="138" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="114" cy="242" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="26" cy="198" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="4" cy="182" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/><circle cx="46" cy="132" r="3" name="svg" class="multipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)(\d+)("\/>)$/'
'/^(<circle cx="72" cy="138" r="3" name="svg" class="multipoint '
. 'vector" fill="white" stroke="#B02EE0" stroke-width="2" id="svg)'
. '(\d+)("\/><circle cx="114" cy="242" r="3" name="svg" class="mult'
. 'ipoint vector" fill="white" stroke="#B02EE0" stroke-width="2" id'
. '="svg)(\d+)("\/><circle cx="26" cy="198" r="3" name="svg" class='
. '"multipoint vector" fill="white" stroke="#B02EE0" stroke-width='
. '"2" id="svg)(\d+)("\/><circle cx="4" cy="182" r="3" name="svg" '
. 'class="multipoint vector" fill="white" stroke="#B02EE0" stroke-'
. 'width="2" id="svg)(\d+)("\/><circle cx="46" cy="132" r="3" name='
. '"svg" class="multipoint vector" fill="white" stroke="#B02EE0" '
. 'stroke-width="2" id="svg)(\d+)("\/>)$/'
)
);
}
@ -346,7 +356,26 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(new Array((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(48,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(69,23)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(35,78)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))), null, {"pointRadius":3,"fillColor":"#ffffff","strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","labelYOffset":-8,"fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.Lon'
. 'Lat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.LonLat'
. '(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.'
. 'getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.'
. 'Feature.Vector(new OpenLayers.Geometry.MultiPoint(new Array(('
. 'new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.'
. 'Projection("EPSG:4326"), map.getProjectionObject()), (new Open'
. 'Layers.Geometry.Point(48,75)).transform(new OpenLayers.Projec'
. 'tion("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.'
. 'Geometry.Point(69,23)).transform(new OpenLayers.Projection("'
. 'EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry'
. '.Point(25,45)).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()), (new OpenLayers.Geometry.Point(14,53)'
. ').transform(new OpenLayers.Projection("EPSG:4326"), map.getProjec'
. 'tionObject()), (new OpenLayers.Geometry.Point(35,78)).transform'
. '(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject('
. ')))), null, {"pointRadius":3,"fillColor":"#ffffff","strokeColor"'
. ':"#B02EE0","strokeWidth":2,"label":"Ol","labelYOffset":-8,'
. '"fontSize":10}));'
)
);
}

View File

@ -403,7 +403,13 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
'scale' => 2,
'height' => 150
),
'/^(<path d=" M 248, 208 L 270, 122 L 8, 138 Z " name="svg" class="multipolygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)(\d+)("\/><path d=" M 186, 288 L 88, 248 L 132, 142 Z " name="svg" class="multipolygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)(\d+)("\/>)$/'
'/^(<path d=" M 248, 208 L 270, 122 L 8, 138 Z " name="svg" class="'
. 'multipolygon vector" stroke="black" stroke-width="0.5" fill="'
. '#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)(\d+)'
. '("\/><path d=" M 186, 288 L 88, 248 L 132, 142 Z " name="svg" '
. 'class="multipolygon vector" stroke="black" stroke-width="0.5" '
. 'fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8" id="svg)'
. '(\d+)("\/>)$/'
)
);
}
@ -452,7 +458,32 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(new Array(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(136,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(147,83)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(16,75)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(136,40)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(105,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(56,20)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(78,73)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(105,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.'
. 'LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.LonLat'
. '(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.ge'
. 'tProjectionObject()));vectorLayer.addFeatures(new OpenLayers.'
. 'Feature.Vector(new OpenLayers.Geometry.MultiPolygon(new Array'
. '(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geo'
. 'metry.LinearRing(new Array((new OpenLayers.Geometry.Point'
. '(136,40)).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()), (new OpenLayers.Geometry.Point(147,'
. '83)).transform(new OpenLayers.Projection("EPSG:4326"), map.get'
. 'ProjectionObject()), (new OpenLayers.Geometry.Point(16,75)).'
. 'transform(new OpenLayers.Projection("EPSG:4326"), map.getPro'
. 'jectionObject()), (new OpenLayers.Geometry.Point(136,40)).trans'
. 'form(new OpenLayers.Projection("EPSG:4326"), map.getProjection'
. 'Object()))))), new OpenLayers.Geometry.Polygon(new Array(new '
. 'OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry'
. '.Point(105,0)).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()), (new OpenLayers.Geometry.Point(56,20)'
. ').transform(new OpenLayers.Projection("EPSG:4326"), map.getProjec'
. 'tionObject()), (new OpenLayers.Geometry.Point(78,73)).transform'
. '(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject'
. '()), (new OpenLayers.Geometry.Point(105,0)).transform(new Open'
. 'Layers.Projection("EPSG:4326"), map.getProjectionObject()))))))'
. '), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":'
. '"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
)
);
}

View File

@ -349,7 +349,16 @@ class PMA_GIS_PointTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector((new OpenLayers.Geometry.Point(12,35)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), null, {"pointRadius":3,"fillColor":"#ffffff","strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","labelYOffset":-8,"fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.'
. 'LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.LonLat'
. '(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()));vectorLayer.addFeatures(new Open'
. 'Layers.Feature.Vector((new OpenLayers.Geometry.Point(12,35)).'
. 'transform(new OpenLayers.Projection("EPSG:4326"), map.get'
. 'ProjectionObject()), null, {"pointRadius":3,"fillColor":"#ffffff"'
. ',"strokeColor":"#B02EE0","strokeWidth":2,"label":"Ol","labelY'
. 'Offset":-8,"fontSize":10}));'
)
);
}

View File

@ -487,7 +487,10 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
'scale' => 2,
'height' => 150
),
'/^(<path d=" M 222, 288 L 22, 228 L 10, 162 Z " name="svg" id="svg)(\d+)(" class="polygon vector" stroke="black" stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" fill-opacity="0.8"\/>)$/'
'/^(<path d=" M 222, 288 L 22, 228 L 10, 162 Z " name="svg" '
. 'id="svg)(\d+)(" class="polygon vector" stroke="black" '
. 'stroke-width="0.5" fill="#B02EE0" fill-rule="evenodd" '
. 'fill-opacity="0.8"\/>)$/'
)
);
}
@ -535,7 +538,23 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest
'maxX' => '1',
'maxY' => '1',
),
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.LonLat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject())); bound.extend(new OpenLayers.LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()));vectorLayer.addFeatures(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(new Array(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.Geometry.Point(123,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(23,30)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(17,63)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.Geometry.Point(123,0)).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()))))), null, {"strokeColor":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0","fillOpacity":0.8,"label":"Ol","fontSize":10}));'
'bound = new OpenLayers.Bounds(); bound.extend(new OpenLayers.Lon'
. 'Lat(0, 0).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject())); bound.extend(new OpenLayers.'
. 'LonLat(1, 1).transform(new OpenLayers.Projection("EPSG:4326"), '
. 'map.getProjectionObject()));vectorLayer.addFeatures(new Open'
. 'Layers.Feature.Vector(new OpenLayers.Geometry.Polygon(new Array'
. '(new OpenLayers.Geometry.LinearRing(new Array((new OpenLayers.'
. 'Geometry.Point(123,0)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.'
. 'Geometry.Point(23,30)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.'
. 'Geometry.Point(17,63)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()), (new OpenLayers.'
. 'Geometry.Point(123,0)).transform(new OpenLayers.Projection'
. '("EPSG:4326"), map.getProjectionObject()))))), null, {"stroke'
. 'Color":"#000000","strokeWidth":0.5,"fillColor":"#B02EE0",'
. '"fillOpacity":0.8,"label":"Ol","fontSize":10}));'
)
);
}

View File

@ -18,6 +18,11 @@ require_once 'libraries/php-gettext/gettext.inc';
*/
class NodeFactory_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['server'] = 0;
@ -25,6 +30,11 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testDefaultNode()
{
$node = PMA_NodeFactory::getInstance();
@ -33,6 +43,11 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase
$this->assertEquals(false, $node->is_group);
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testDefaultContainer()
{
$node = PMA_NodeFactory::getInstance('Node', 'default', Node::CONTAINER);
@ -41,6 +56,11 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase
$this->assertEquals(false, $node->is_group);
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testGroupContainer()
{
$node = PMA_NodeFactory::getInstance(
@ -51,12 +71,22 @@ class NodeFactory_Test extends PHPUnit_Framework_TestCase
$this->assertEquals(true, $node->is_group);
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testFileError()
{
$this->setExpectedException('PHPUnit_Framework_Error');
PMA_NodeFactory::getInstance('Node_DoesNotExist');
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testClassNameError()
{
$this->setExpectedException('PHPUnit_Framework_Error');

View File

@ -17,6 +17,11 @@ require_once 'libraries/Theme.class.php';
*/
class Node_Column_Container_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['server'] = 0;
@ -24,6 +29,11 @@ class Node_Column_Container_Test extends PHPUnit_Framework_TestCase
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
}
/**
* Test for PMA_NodeFactory::__construct
*
* @return void
*/
public function testConstructor()
{
$parent = PMA_NodeFactory::getInstance('Node_Column_Container');

View File

@ -17,6 +17,11 @@ require_once 'libraries/Theme.class.php';
*/
class Node_Column_Test extends PHPUnit_Framework_TestCase
{
/**
* SetUp for test cases
*
* @return void
*/
public function setup()
{
$GLOBALS['server'] = 0;
@ -24,6 +29,11 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
}
/**
* Test for PMA_NodeFactory::getInstance
*
* @return void
*/
public function testConstructor()
{
$parent = PMA_NodeFactory::getInstance('Node_Column');
@ -51,10 +61,16 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase
$query .= "AND `TABLE_NAME`='tableName' ";
$query .= "AND `COLUMN_NAME`='colName' ";
$dbNode = PMA_NodeFactory::getInstance('Node_Database', 'dbName', Node::OBJECT);
$tableNode = PMA_NodeFactory::getInstance('Node_Table', 'tableName', Node::OBJECT);
$dbNode = PMA_NodeFactory::getInstance(
'Node_Database', 'dbName', Node::OBJECT
);
$tableNode = PMA_NodeFactory::getInstance(
'Node_Table', 'tableName', Node::OBJECT
);
$dbNode->addChild($tableNode);
$colNode = PMA_NodeFactory::getInstance('Node_Column', 'colName', Node::OBJECT);
$colNode = PMA_NodeFactory::getInstance(
'Node_Column', 'colName', Node::OBJECT
);
$tableNode->addChild($colNode);
$dbi = $this->getMockBuilder('PMA_DatabaseInterface')

View File

@ -72,7 +72,9 @@ class Node_Test extends PHPUnit_Framework_TestCase
public function testNodeHasChildren()
{
$parent = PMA_NodeFactory::getInstance();
$empty_container = PMA_NodeFactory::getInstance('Node', 'empty', Node::CONTAINER);
$empty_container = PMA_NodeFactory::getInstance(
'Node', 'empty', Node::CONTAINER
);
$child = PMA_NodeFactory::getInstance();
// test with no children
$this->assertEquals(
@ -119,7 +121,9 @@ class Node_Test extends PHPUnit_Framework_TestCase
$child->addChild(PMA_NodeFactory::getInstance());
$this->assertEquals($parent->numChildren(), 1);
// add a container, this one doesn't count wither
$container = PMA_NodeFactory::getInstance('Node', 'default', Node::CONTAINER);
$container = PMA_NodeFactory::getInstance(
'Node', 'default', Node::CONTAINER
);
$parent->addChild($container);
$this->assertEquals($parent->numChildren(), 1);
// add a grandchild to container, this one counts
@ -140,7 +144,10 @@ class Node_Test extends PHPUnit_Framework_TestCase
$parent->addChild($child);
$this->assertEquals($child->parents(), array($parent)); // exclude self
$this->assertEquals($child->parents(true), array($child, $parent)); // include self
$this->assertEquals(
$child->parents(true),
array($child, $parent)
); // include self
}
public function testRealParent()

View File

@ -175,7 +175,8 @@ class ImportLdi_Test extends PHPUnit_Framework_TestCase
//asset that all sql are executed
$this->assertContains(
"LOAD DATA INFILE 'test/test_data/db_test_ldi.csv' INTO TABLE `phpmyadmintest`",
"LOAD DATA INFILE 'test/test_data/db_test_ldi.csv' INTO TABLE "
. "`phpmyadmintest`",
$sql_query
);
@ -221,8 +222,8 @@ class ImportLdi_Test extends PHPUnit_Framework_TestCase
*/
public function testDoImportLDISetting()
{
global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, $ldi_enclosed,
$ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns;
global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated,
$ldi_enclosed, $ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns;
//$sql_query_disabled will show the import SQL detail
global $sql_query, $sql_query_disabled;
@ -243,7 +244,8 @@ class ImportLdi_Test extends PHPUnit_Framework_TestCase
//asset that all sql are executed
//replace
$this->assertContains(
"LOAD DATA LOCAL INFILE 'test/test_data/db_test_ldi.csv' REPLACE INTO TABLE `phpmyadmintest`",
"LOAD DATA LOCAL INFILE 'test/test_data/db_test_ldi.csv' REPLACE INTO "
. "TABLE `phpmyadmintest`",
$sql_query
);

View File

@ -133,9 +133,11 @@ class ImportMediawiki_Test extends PHPUnit_Framework_TestCase
$this->object->doImport();
//If import successfully, PMA will show all databases and tables imported as following HTML Page
// If import successfully, PMA will show all databases and
// tables imported as following HTML Page
/*
The following structures have either been created or altered. Here you can:
The following structures have either been created or altered. Here you
can:
View a structure's contents by clicking on its name
Change any of its settings by clicking the corresponding "Options" link
Edit structure by following the "Structure" link

View File

@ -139,7 +139,8 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase
//asset that all sql are executed
$this->assertContains(
'CREATE DATABASE IF NOT EXISTS `ODS_DB` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci',
'CREATE DATABASE IF NOT EXISTS `ODS_DB` DEFAULT CHARACTER SET '
. 'utf8 COLLATE utf8_general_ci',
$sql_query
);
$this->assertContains(
@ -147,7 +148,8 @@ class ImportOds_Test extends PHPUnit_Framework_TestCase
$sql_query
);
$this->assertContains(
"INSERT INTO `ODS_DB`.`pma_bookmark` (`A`, `B`, `C`, `D`) VALUES (1, 'dbbase', NULL, 'ddd');",
"INSERT INTO `ODS_DB`.`pma_bookmark` (`A`, `B`, `C`, `D`) VALUES "
. "(1, 'dbbase', NULL, 'ddd');",
$sql_query
);

View File

@ -108,7 +108,8 @@ class ImportSql_Test extends PHPUnit_Framework_TestCase
$sql_query
);
$this->assertContains(
'INSERT INTO `pma_bookmark` (`id`, `dbase`, `user`, `label`, `query`) VALUES',
'INSERT INTO `pma_bookmark` (`id`, `dbase`, `user`, `label`, `query`) '
. 'VALUES',
$sql_query
);

View File

@ -55,7 +55,8 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase
$GLOBALS['cfg']['ServerDefault'] = 0;
$GLOBALS['cfg']['AllowUserDropDatabase'] = false;
$GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_For_Testing.xml';
$GLOBALS['import_file'] = 'test/test_data/phpmyadmin_importXML_'
. 'For_Testing.xml';
$GLOBALS['import_text'] = 'ImportXml_Test';
$GLOBALS['compression'] = 'none';
$GLOBALS['read_multiply'] = 10;
@ -129,9 +130,11 @@ class ImportXml_Test extends PHPUnit_Framework_TestCase
//Test function called
$this->object->doImport();
//If import successfully, PMA will show all databases and tables imported as following HTML Page
// If import successfully, PMA will show all databases and tables
// imported as following HTML Page
/*
The following structures have either been created or altered. Here you can:
The following structures have either been created or altered. Here you
can:
View a structure's contents by clicking on its name
Change any of its settings by clicking the corresponding "Options" link
Edit structure by following the "Structure" link