diff --git a/test/bootstrap-dist.php b/test/bootstrap-dist.php index 95cca261bd..95410d4495 100644 --- a/test/bootstrap-dist.php +++ b/test/bootstrap-dist.php @@ -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() { diff --git a/test/classes/PMA_Advisor_test.php b/test/classes/PMA_Advisor_test.php index a7000bd3d9..d190395aec 100644 --- a/test/classes/PMA_Advisor_test.php +++ b/test/classes/PMA_Advisor_test.php @@ -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 status_var' + 'recommendation' => 'Recommend status_var' ), 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 web', + 'recommendation' => 'See web', 'id' => 'Distribution' ), null, diff --git a/test/classes/PMA_Config_test.php b/test/classes/PMA_Config_test.php index 0546dfbeb9..9b5787019c 100644 --- a/test/classes/PMA_Config_test.php +++ b/test/classes/PMA_Config_test.php @@ -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 diff --git a/test/classes/PMA_DBQbe_test.php b/test/classes/PMA_DBQbe_test.php index bf68b91a72..b4a27e51af 100644 --- a/test/classes/PMA_DBQbe_test.php +++ b/test/classes/PMA_DBQbe_test.php @@ -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( - '', + '', $this->_callProtectedFunction( '_getSortSelectCell', array(1) @@ -88,7 +96,17 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetSortRow() { $this->assertEquals( - 'Sort:', + 'Sort:' + . '' + . '' + . '', $this->_callProtectedFunction( '_getSortRow', array() @@ -104,7 +122,11 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetShowRow() { $this->assertEquals( - 'Show:', + 'Show:' + . '' + . '', $this->_callProtectedFunction( '_getShowRow', array() @@ -120,7 +142,16 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetCriteriaInputboxRow() { $this->assertEquals( - 'Criteria:', + 'Criteria:' + . '' + . '' + . '' + . '' + . '' + . '', $this->_callProtectedFunction( '_getCriteriaInputboxRow', array() @@ -136,7 +167,12 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetFootersOptions() { $this->assertEquals( - '
Add/Delete criteria rows:
', + '
Add/Delete criteria rows:
', $this->_callProtectedFunction( '_getFootersOptions', array('row') @@ -152,7 +188,18 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetTableFooters() { $this->assertEquals( - '
Add/Delete criteria rows:
Add/Delete columns:
', + '
Add/Delete criteria' + . ' rows:
Add/Delete columns:
', $this->_callProtectedFunction( '_getTableFooters', array() @@ -168,7 +215,12 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetAndOrColCell() { $this->assertEquals( - 'Or:  And:
Ins  Del', + 'Or:  And:' + . '
Ins  Del', $this->_callProtectedFunction( '_getAndOrColCell', array(1) @@ -184,7 +236,23 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase public function testGetModifyColumnsRow() { $this->assertEquals( - 'Modify:Or:  And:
Ins  DelOr:  And:
Ins  DelOr:  And:
Ins  Del', + 'Modify:' + . 'Or:  And:
Ins' + . '  ' + . 'DelOr:  And:' + . '
Ins  DelOr:' + . '  And:
Ins  Del' + . '', $this->_callProtectedFunction( '_getModifyColumnsRow', array() @@ -201,7 +269,15 @@ class PMA_DBQbe_Test extends PHPUnit_Framework_TestCase { $GLOBALS['cell_align_right'] = 'cellAlign'; $this->assertEquals( - '
Ins:And:
Del:Or:
', + '
Ins:' + . 'And:
Del:' + . 'Or:
', $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( - '', + '' + . '', $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( - '
Ins:And:
Del:Or:
', + '' + . '
Ins:And:' + . '
Del:' + . 'Or:' + . '
', $this->_callProtectedFunction( '_getInsDelAndOrCriteriaRows', array(2,3) diff --git a/test/classes/PMA_DbSearch_test.php b/test/classes/PMA_DbSearch_test.php index 28372bbb2b..6b721d64b8 100644 --- a/test/classes/PMA_DbSearch_test.php +++ b/test/classes/PMA_DbSearch_test.php @@ -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( - '
Search results for "" :
', + '
Search results ' + . 'for "" :
', $this->object->getSearchResults() ); } @@ -150,7 +152,22 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase 'delete' => 'column2' ), true, - '2 matches in table1BrowseDelete' + '2 matches in table1' + . 'BrowseDelete' ) ); } @@ -166,15 +183,56 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase $GLOBALS['pmaThemeImage'] = 'themes/dot.gif'; $url_params = array('param1', 'param2'); $this->assertEquals( - '
Search in database
Words or values to search for (wildcard: "%"):
Find: -
- -
- -
- -
-
Inside tables:
Select All  / Unselect All
Inside column:

', + '
' + . '
Search in database' + . '' + . '
Words or values to search for (wildcard: "%"):' + . '
Find:' . "\n" + . '
' . "\n" + . '' . "\n" + . '
' . "\n" + . '' . "\n" + . '
' + . "\n" . '' . "\n" + . '
' . "\n" + . '
Inside tables:
Select ' + . 'All  / Unselect' + . ' All
Inside column:' + . '' + . '
' + . '

' + . '
', $this->object->getSelectionForm($url_params) ); } @@ -187,7 +245,14 @@ class PMA_DbSearch_Test extends PHPUnit_Framework_TestCase public function testGetResultDivs() { $this->assertEquals( - '

', + '
' + . '
' + . '

' + . '
' + . '', $this->_callProtectedFunction( '_getResultDivs', array() diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index d1aab572b9..61d1257a15 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -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'), - ' ' + array('edit_lnk' => null, 'del_lnk' => null), + //array('edit_lnk' => 'nn', 'del_lnk' => 'nn'), + '' + . ' ' ) ); } @@ -640,8 +650,18 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase ) { $vertical_display = array( 'row_delete' => array( - ' ', - ' ' + ' ' + . '', + ' ' + . '' ) ); @@ -735,7 +755,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase { return array( array( - 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=d1aecb47ef7c081e068e7008b38a5d76', + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60' + . '.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=' + . 'The+row+has+been+deleted&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&' + . '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', - ' ' + ' ' + . '' ) ); } @@ -800,14 +831,25 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase { return array( array( - 'tbl_change.php?db=Data&table=customer&where_clause=%60customer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_action=update&token=bbd5003198a3bd856b21d9607d6c6a1e', + 'tbl_change.php?db=Data&table=customer&where_clause=%60' + . 'customer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=' + . 'SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_' + . 'action=update&token=bbd5003198a3bd856b21d9607d6c6a1e', 'odd edit_row_anchor row_0 vpointer vmarker', - 'Edit Edit', + '
+                . Edit', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', - ' -Edit Edit -' + '' + . '' . "\n" + . ' Edit' . "\n" + . '' ) ); } @@ -852,14 +894,25 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase { return array( array( - 'tbl_change.php?db=Data&table=customer&where_clause=%60customer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_action=insert&token=f597309d3a066c3c81a6cb015a79636d', - 'Copy Copy', + 'tbl_change.php?db=Data&table=customer&where_clause=%60cust' + . 'omer%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=' + . 'SELECT+%2A+FROM+%60customer%60&goto=sql.php&default_' + . 'action=insert&token=f597309d3a066c3c81a6cb015a79636d', + ' Copy', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', 'odd row_0 vpointer vmarker', - ' -Copy Copy -' + '' . "\n" + . ' Copy' . "\n" + . '' ) ); } @@ -904,13 +957,30 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase { return array( array( - 'sql.php?db=Data&table=customer&sql_query=DELETE+FROM+%60Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=f597309d3a066c3c81a6cb015a79636d', - 'Delete Delete', + 'sql.php?db=Data&table=customer&sql_query=DELETE+FROM+%60' + . 'Data%60.%60customer%60+WHERE+%60customer%60.%60id%60+%3D+1&' + . 'message_to_show=The+row+has+been+deleted&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&token=f597309d3a066c3c81a6cb015a79636d', + ' Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'odd row_0 vpointer vmarker', - ' -Delete Delete -
DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1
' + '' . "\n" + . 'Delete ' + . 'Delete' . "\n" + . '
DELETE FROM `Data`.`customer` WHERE ' + . '`customer`.`id` = 1
' ) ); } @@ -955,7 +1025,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase return array( array( PMA_DisplayResults::POSITION_LEFT, - 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data' + . '%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=' + . 'The+row+has+been+deleted&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' + . '&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&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', - 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.' + . '%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+' + . 'FROM+%60new%60&goto=sql.php&default_action=update&' + . 'token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.' + . '%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+' + . 'FROM+%60new%60&goto=sql.php&default_action=insert&' + . 'token=ae4c6d18375f446dfa068420c1f6a4e8', 'edit_row_anchor', - 'Edit Edit', - 'Copy Copy', - 'Delete Delete', + ' Edit', + ' Copy', + ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - ' -Edit Edit - -Copy Copy - -Delete Delete -
DELETE FROM `data`.`new` WHERE `new`.`id` = 1
' + ' ' . "\n" + . '' + . ' Edit' . "\n" + . '' . "\n" + . 'Copy Copy' . "\n" + . '' . "\n" + . 'Delete ' + . 'Delete' . "\n" + . '
DELETE FROM `data`.`new` WHERE `new`.`id` = 1' + . '
' ), array( PMA_DisplayResults::POSITION_RIGHT, - 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60' + . '.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=' + . 'The+row+has+been+deleted&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&' + . '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&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', - 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.' + . '%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+' + . 'FROM+%60new%60&goto=sql.php&default_action=update&' + . 'token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.' + . '%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+' + . 'FROM+%60new%60&goto=sql.php&default_action=insert&' + . 'token=ae4c6d18375f446dfa068420c1f6a4e8', 'edit_row_anchor', - 'Edit Edit', - 'Copy Copy', - 'Delete Delete', + ' Edit', + ' Copy', + ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - ' -Delete Delete -
DELETE FROM `data`.`new` WHERE `new`.`id` = 1
-Copy Copy - -Edit Edit - ' + '' . "\n" + . 'Delete Delete' + . "\n" . '
DELETE FROM `data`.`new` WHERE `new`.' + . '`id` = 1
' + . "\n" . 'Copy Copy' . "\n" + . '' + . '' . "\n" + . 'Edit Edit' . "\n" + . ' ' ), array( PMA_DisplayResults::POSITION_NONE, - 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.' + . '%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+' + . 'row+has+been+deleted&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&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&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', - 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60' + . 'id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+' + . '%60new%60&goto=sql.php&default_action=update&token=' + . 'ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60' + . 'id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+' + . '%60new%60&goto=sql.php&default_action=insert&token=' + . 'ae4c6d18375f446dfa068420c1f6a4e8', 'edit_row_anchor', - 'Edit Edit', - 'Copy Copy', - 'Delete Delete', + ' Edit', + ' Copy', + ' Delete', 'DELETE FROM `data`.`new` WHERE `new`.`id` = 1', - ' ' + ' ' ), ); } @@ -1129,7 +1302,13 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase return array( array( PMA_DisplayResults::POSITION_NONE, - 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+row+has+been+deleted&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&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'sql.php?db=data&table=new&sql_query=DELETE+FROM+%60data%60.' + . '%60new%60+WHERE+%60new%60.%60id%60+%3D+1&message_to_show=The+' + . 'row+has+been+deleted&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&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&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=update&token=ae4c6d18375f446dfa068420c1f6a4e8', - 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+%60new%60&goto=sql.php&default_action=insert&token=ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60' + . 'id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+' + . '%60new%60&goto=sql.php&default_action=update&token=' + . 'ae4c6d18375f446dfa068420c1f6a4e8', + 'tbl_change.php?db=data&table=new&where_clause=%60new%60.%60' + . 'id%60+%3D+1&clause_is_unique=1&sql_query=SELECT+%2A+FROM+' + . '%60new%60&goto=sql.php&default_action=insert&token=' + . 'ae4c6d18375f446dfa068420c1f6a4e8', 'edit_row_anchor', - 'Edit Edit', - 'Copy Copy', - 'Delete Delete', + ' Edit', + ' Copy', + ' Delete', null, - ' ' + ' ' ) ); } @@ -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&db=data&execute_dialog=1&item_type=FUNCTION&server=0&lang=en&token=token' + 'db_routines.php?item_name=circumference&db=data&execute_' + . 'dialog=1&item_type=FUNCTION&server=0&lang=en&' + . '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&db=data&execute_routine=1&item_type=PROCEDURE&server=0&lang=en&token=token' + 'db_routines.php?item_name=area&db=data&execute_routine=1' + . '&item_type=PROCEDURE&server=0&lang=en&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&db=information_schema&test_name=value&server=0&lang=en&token=token' + 'index.php?sql_query=SELECT+%60CHARACTER_SET_NAME%60+FROM+%60info' + . 'rmation_schema%60.%60CHARACTER_SETS%60&db=information_schema' + . '&test_name=value&server=0&lang=en&token=token' ) ); } @@ -1545,8 +1744,16 @@ class PMA_DisplayResults_Test extends PHPUnit_Framework_TestCase 'user', 'tbl_structure.php', 'SELECT * FROM `user`', - ' -
' + "\n" + . '
' + . '
' ) ); } diff --git a/test/classes/PMA_File_test.php b/test/classes/PMA_File_test.php index b28421a58f..ba924339ed 100644 --- a/test/classes/PMA_File_test.php +++ b/test/classes/PMA_File_test.php @@ -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( diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php index 4354cd0893..3a1f8689c7 100644 --- a/test/classes/PMA_Footer_test.php +++ b/test/classes/PMA_Footer_test.php @@ -123,7 +123,8 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase ); $this->assertRegExp( - '/
2 queries executed 2 times in 2.7 seconds
/',
+            '/
2 queries executed 2 times in 2.7 seconds' + . '
/',
             $this->_callPrivateFunction(
                 '_getDebugMessage',
                 array()
@@ -143,7 +144,10 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
         $GLOBALS['cfg']['ServerDefault'] = 1;
 
         $this->assertEquals(
-            '',
+            '',
             $this->_callPrivateFunction(
                 '_getSelfLink',
                 array(
@@ -167,7 +171,11 @@ class PMA_Footer_Test extends PHPUnit_Framework_TestCase
         $GLOBALS['pmaThemeImage'] = 'image';
 
         $this->assertEquals(
-            '',
+            '',
             $this->_callPrivateFunction(
                 '_getSelfLink',
                 array(
diff --git a/test/classes/PMA_List_Database_test.php b/test/classes/PMA_List_Database_test.php
index d7ac76e476..984069561e 100644
--- a/test/classes/PMA_List_Database_test.php
+++ b/test/classes/PMA_List_Database_test.php
@@ -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('' . "\n", $arr->getHtmlOptions());
+        $this->assertEquals(
+            '' . "\n",
+            $arr->getHtmlOptions()
+        );
     }
 
     /**
diff --git a/test/classes/PMA_Message_test.php b/test/classes/PMA_Message_test.php
index 60912aac54..735c5b178c 100644
--- a/test/classes/PMA_Message_test.php
+++ b/test/classes/PMA_Message_test.php
@@ -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]',
-                'link'
+                'link'
             ),
             array(
                 '[a@./non-existing@Documentation]link[/a]',
@@ -352,7 +363,9 @@ class PMA_Message_Test extends PHPUnit_Framework_TestCase
             ),
             array(
                 '[doc@foo]link[/doc]',
-                'link'
+                'link'
             ),
         );
     }
@@ -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(
-            'test test',
+            'test test',
             $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('
Test Message
'); + $this->expectOutputString( + '
' + . 'Test Message
' + ); $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( - '
Test Message
', + '
' + . 'Test Message
', $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, '
1 row affected.
'), - array(2, '
2 rows affected.
'), - array(10000, '
10000 rows affected.
'), + array( + 1, + '
1 row affected.
' + ), + array( + 2, + '
2 rows affected.
' + ), + array( + 10000, + '
10000 rows affected.
' + ) ); } @@ -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, '
1 row inserted.
'), - array(2, '
2 rows inserted.
'), - array(100000, '
100000 rows inserted.
'), + array( + 1, + '
1 row inserted.
' + ), + array( + 2, + '
2 rows inserted.
' + ), + array( + 100000, + '
100000 rows inserted.
' + ) ); } @@ -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, '
1 row deleted.
'), - array(2, '
2 rows deleted.
'), - array(500000, '
500000 rows deleted.
'), + array( + 1, + '
1 row deleted.
' + ), + array( + 2, + '
2 rows deleted.
' + ), + array( + 500000, + '
500000 rows deleted.
' + ) ); } diff --git a/test/classes/PMA_PDF_test.php b/test/classes/PMA_PDF_test.php index 4ca24ce1ca..a839e868b2 100644 --- a/test/classes/PMA_PDF_test.php +++ b/test/classes/PMA_PDF_test.php @@ -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() { diff --git a/test/classes/PMA_Scripts_test.php b/test/classes/PMA_Scripts_test.php index 565b3150c0..2c7cffc5f6 100644 --- a/test/classes/PMA_Scripts_test.php +++ b/test/classes/PMA_Scripts_test.php @@ -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( - '', + '', $this->_callPrivateFunction( '_includeFiles', array( @@ -101,11 +106,13 @@ class PMA_Scripts_Test extends PHPUnit_Framework_TestCase $this->object->addEvent('onClick', 'doSomething'); $this->assertRegExp( - '@@', + '@@', $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( diff --git a/test/classes/PMA_TableReplaceSearch_test.php b/test/classes/PMA_TableReplaceSearch_test.php index 79c24b1ba3..2cb5edcf17 100644 --- a/test/classes/PMA_TableReplaceSearch_test.php +++ b/test/classes/PMA_TableReplaceSearch_test.php @@ -107,7 +107,8 @@ class PMA_TableReplaceSearchTest extends PHPUnit_Framework_TestCase $ret ); $this->assertContains( - '', + '', $ret ); diff --git a/test/classes/PMA_TableSearch_test.php b/test/classes/PMA_TableSearch_test.php index 019eee434a..9152be61e9 100644 --- a/test/classes/PMA_TableSearch_test.php +++ b/test/classes/PMA_TableSearch_test.php @@ -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 diff --git a/test/classes/PMA_Table_test.php b/test/classes/PMA_Table_test.php index 25a648e708..34b47a6da8 100644 --- a/test/classes/PMA_Table_test.php +++ b/test/classes/PMA_Table_test.php @@ -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) diff --git a/test/classes/PMA_Theme_Manager_test.php b/test/classes/PMA_Theme_Manager_test.php index 71d8d2d6c2..0fbffa4cdb 100644 --- a/test/classes/PMA_Theme_Manager_test.php +++ b/test/classes/PMA_Theme_Manager_test.php @@ -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( - '

Original (2.9)

Original
[ take it ]

pmahomme (1.1)

pmahomme
[ take it ]

', + '

Original (2.9)


[ take it ]' + . '

pmahomme (1.1)

' + . 'pmahomme
[ take it' + . ' ]

', $tm->getPrintPreviews() ); } diff --git a/test/classes/PMA_Theme_test.php b/test/classes/PMA_Theme_test.php index f5f4d33b3c..d586035ce2 100644 --- a/test/classes/PMA_Theme_test.php +++ b/test/classes/PMA_Theme_test.php @@ -1,6 +1,10 @@ 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(), - '' + '' ); } @@ -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);' ); } diff --git a/test/classes/PMA_Types_Drizzle_test.php b/test/classes/PMA_Types_Drizzle_test.php index e50e5e0ca8..9b804444a7 100644 --- a/test/classes/PMA_Types_Drizzle_test.php +++ b/test/classes/PMA_Types_Drizzle_test.php @@ -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() { diff --git a/test/classes/PMA_Util_test.php b/test/classes/PMA_Util_test.php index 6620e24b1c..15705699ec 100644 --- a/test/classes/PMA_Util_test.php +++ b/test/classes/PMA_Util_test.php @@ -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 * diff --git a/test/classes/gis/PMA_GIS_Geometrycollection_test.php b/test/classes/gis/PMA_GIS_Geometrycollection_test.php index 862b204dbe..2ac79a3b44 100644 --- a/test/classes/gis/PMA_GIS_Geometrycollection_test.php +++ b/test/classes/gis/PMA_GIS_Geometrycollection_test.php @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Linestring_test.php b/test/classes/gis/PMA_GIS_Linestring_test.php index 37bad00846..b28056a90b 100644 --- a/test/classes/gis/PMA_GIS_Linestring_test.php +++ b/test/classes/gis/PMA_GIS_Linestring_test.php @@ -293,7 +293,9 @@ class PMA_GIS_LinestringTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - '/^()$/' + '/^()$/' ) ); } @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Multilinestring_test.php b/test/classes/gis/PMA_GIS_Multilinestring_test.php index 11d98d85d0..8793e477e8 100644 --- a/test/classes/gis/PMA_GIS_Multilinestring_test.php +++ b/test/classes/gis/PMA_GIS_Multilinestring_test.php @@ -354,7 +354,11 @@ class PMA_GIS_MultilinestringTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - '/^()$/' + '/^()$/' ) ); } @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Multipoint_test.php b/test/classes/gis/PMA_GIS_Multipoint_test.php index dda343bced..79f9b8ced4 100644 --- a/test/classes/gis/PMA_GIS_Multipoint_test.php +++ b/test/classes/gis/PMA_GIS_Multipoint_test.php @@ -298,7 +298,17 @@ class PMA_GIS_MultipointTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - '/^()$/' + '/^()$/' ) ); } @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Multipolygon_test.php b/test/classes/gis/PMA_GIS_Multipolygon_test.php index 2399cd90a7..a9610b5249 100644 --- a/test/classes/gis/PMA_GIS_Multipolygon_test.php +++ b/test/classes/gis/PMA_GIS_Multipolygon_test.php @@ -403,7 +403,13 @@ class PMA_GIS_MultipolygonTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - '/^()$/' + '/^()$/' ) ); } @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Point_test.php b/test/classes/gis/PMA_GIS_Point_test.php index 232467a090..09fa177563 100644 --- a/test/classes/gis/PMA_GIS_Point_test.php +++ b/test/classes/gis/PMA_GIS_Point_test.php @@ -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}));' ) ); } diff --git a/test/classes/gis/PMA_GIS_Polygon_test.php b/test/classes/gis/PMA_GIS_Polygon_test.php index b82020c876..c8e6ab0105 100644 --- a/test/classes/gis/PMA_GIS_Polygon_test.php +++ b/test/classes/gis/PMA_GIS_Polygon_test.php @@ -487,7 +487,10 @@ class PMA_GIS_PolygonTest extends PMA_GIS_GeomTest 'scale' => 2, 'height' => 150 ), - '/^()$/' + '/^()$/' ) ); } @@ -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}));' ) ); } diff --git a/test/classes/navigation/PMA_NodeFactory_test.php b/test/classes/navigation/PMA_NodeFactory_test.php index 9288070e70..f7ed29e972 100644 --- a/test/classes/navigation/PMA_NodeFactory_test.php +++ b/test/classes/navigation/PMA_NodeFactory_test.php @@ -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'); diff --git a/test/classes/navigation/PMA_Node_Column_Container_test.php b/test/classes/navigation/PMA_Node_Column_Container_test.php index 44beb1afef..71f731bcfd 100644 --- a/test/classes/navigation/PMA_Node_Column_Container_test.php +++ b/test/classes/navigation/PMA_Node_Column_Container_test.php @@ -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'); diff --git a/test/classes/navigation/PMA_Node_Column_test.php b/test/classes/navigation/PMA_Node_Column_test.php index 625815b5b2..2fe9996fea 100644 --- a/test/classes/navigation/PMA_Node_Column_test.php +++ b/test/classes/navigation/PMA_Node_Column_test.php @@ -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') diff --git a/test/classes/navigation/PMA_Node_test.php b/test/classes/navigation/PMA_Node_test.php index ac632c3fa1..4a25d262be 100644 --- a/test/classes/navigation/PMA_Node_test.php +++ b/test/classes/navigation/PMA_Node_test.php @@ -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() diff --git a/test/classes/plugin/import/ImportLdi_test.php b/test/classes/plugin/import/ImportLdi_test.php index 5e5b5b02b1..ac039704fc 100644 --- a/test/classes/plugin/import/ImportLdi_test.php +++ b/test/classes/plugin/import/ImportLdi_test.php @@ -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 ); diff --git a/test/classes/plugin/import/ImportMediawiki_test.php b/test/classes/plugin/import/ImportMediawiki_test.php index dfe89efbdd..2b024b07ed 100644 --- a/test/classes/plugin/import/ImportMediawiki_test.php +++ b/test/classes/plugin/import/ImportMediawiki_test.php @@ -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 diff --git a/test/classes/plugin/import/ImportOds_test.php b/test/classes/plugin/import/ImportOds_test.php index ea70db21ee..78c49ad348 100644 --- a/test/classes/plugin/import/ImportOds_test.php +++ b/test/classes/plugin/import/ImportOds_test.php @@ -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 ); diff --git a/test/classes/plugin/import/ImportSql_test.php b/test/classes/plugin/import/ImportSql_test.php index dafb9c20c5..2d590e744b 100644 --- a/test/classes/plugin/import/ImportSql_test.php +++ b/test/classes/plugin/import/ImportSql_test.php @@ -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 ); diff --git a/test/classes/plugin/import/ImportXml_test.php b/test/classes/plugin/import/ImportXml_test.php index c1b3fb93cd..1f3d0fa425 100644 --- a/test/classes/plugin/import/ImportXml_test.php +++ b/test/classes/plugin/import/ImportXml_test.php @@ -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