unit test refactoring + fix : some tests still need to be fixed. Read tests/README...
authorioguix <ioguix>
Tue, 4 Sep 2007 19:39:48 +0000 (19:39 +0000)
committerioguix <ioguix>
Tue, 4 Sep 2007 19:39:48 +0000 (19:39 +0000)
41 files changed:
login.php
sql.php
tests/README
tests/testcase/Common/ExportTest.php
tests/testcase/Common/ImportTest.php
tests/testcase/Common/SecurityTest.php
tests/testcase/Databases/AdminTest.php
tests/testcase/Databases/CastsTest.php
tests/testcase/Databases/DatabaseGroupTest.php
tests/testcase/Databases/DatabaseTest.php
tests/testcase/Databases/FindObjectsTest.php
tests/testcase/Databases/HelpTest.php
tests/testcase/Databases/LanguageTest.php
tests/testcase/Databases/ProcessesTest.php
tests/testcase/Databases/SchemaBasicTest.php
tests/testcase/Databases/SqlTest.php
tests/testcase/Databases/VariablesTest.php
tests/testcase/Public/SetPrecondition.php
tests/testcase/Schemas/AggregateTest.php
tests/testcase/Schemas/ConversionTest.php
tests/testcase/Schemas/DomainTest.php
tests/testcase/Schemas/FunctionTest.php
tests/testcase/Schemas/OpClassTest.php
tests/testcase/Schemas/OperatorTest.php
tests/testcase/Schemas/SchemasGroupTest.php
tests/testcase/Schemas/SequenceTest.php
tests/testcase/Schemas/TableTest.php
tests/testcase/Schemas/TypeTest.php
tests/testcase/Schemas/ViewTest.php
tests/testcase/Server/GroupsTest.php
tests/testcase/Server/ReportsTest.php
tests/testcase/Server/TableSpacesTest.php
tests/testcase/Server/UsersTest.php
tests/testcase/Tables/ColumnTest.php
tests/testcase/Tables/ConstraintsTest.php
tests/testcase/Tables/DeadlockTest.php
tests/testcase/Tables/IndexesTest.php
tests/testcase/Tables/InfoTest.php
tests/testcase/Tables/RulesTest.php
tests/testcase/Tables/TriggersTest.php
tests/testcase/testphpPgAdminMain.php

index 9536c8cb6dcfcae7035079e191aa2223f4669e26..cdcf311e7063edb9d9f9bf80a34a846ab79ff3c5 100755 (executable)
--- a/login.php
+++ b/login.php
@@ -3,7 +3,7 @@
        /**
         * Login screen
         *
-        * $Id: login.php,v 1.37 2007/07/12 19:26:22 xzilla Exp $
+        * $Id: login.php,v 1.38 2007/09/04 19:39:48 ioguix Exp $
         */
        global $conf;
        
@@ -24,7 +24,7 @@
        $md5_server = md5($_REQUEST['server']);
 ?>
 
-<form action="redirect.php" method="post" name="login_form">
+<form id="login_form" action="redirect.php" method="post" name="login_form">
 <?php
        if (!empty($_POST)) $vars =& $_POST;
        else $vars =& $_GET;
@@ -42,7 +42,7 @@
                </tr>
                <tr>
                        <td><?php echo $lang['strpassword']; ?></td>
-                       <td><input type="password" name="loginPassword_<?php echo $md5_server; ?>" size="24" /></td>
+                       <td><input id="loginPassword" type="password" name="loginPassword_<?php echo $md5_server; ?>" size="24" /></td>
                </tr>
        </table>
 <?php if (sizeof($conf['servers']) > 1) : ?>
diff --git a/sql.php b/sql.php
index f24afa6faab55ca6fde9598ad78fe1dda69501b1..53ee0902b0d83004388d9e49b871e3c273531dde 100644 (file)
--- a/sql.php
+++ b/sql.php
@@ -6,7 +6,7 @@
         * how many SQL statements have been strung together with semi-colons
         * @param $query The SQL query string to execute
         *
-        * $Id: sql.php,v 1.36 2007/05/28 17:30:32 ioguix Exp $
+        * $Id: sql.php,v 1.37 2007/09/04 19:39:48 ioguix Exp $
         */
 
        // Prevent timeouts on large exports (non-safe mode only)
                        elseif ($data->conn->Affected_Rows() > 0) {
                                echo "<p>", $data->conn->Affected_Rows(), " {$lang['strrowsaff']}</p>\n";
                        }
-                       // Otherwise output nothing...
+                       // Otherwise nodata to print
+                       else echo '<p>', $lang['strnodata'], "</p>\n";
                }
        }
 
index 337e9d45dc3e1fe1a6671f8da5dd9bf35a713def..246ca1ee65cdca3d734b93a00d22dd9ce637b538 100644 (file)
@@ -1,8 +1,43 @@
-\r
-\r
-README\r
-\r
-\r
+Howto configure/run:\r
+       - download the latest simpletest code and untargz it where you want (http://prdownloads.sourceforge.net/simpletest/simpletest_1.0.1beta2.tar.gz)\r
+       - tests are connecting to the server given in conf['servers'][0] values from your config.inc.php\r
+       - cd to your ppa tests directory\r
+       - edit config.tests.php\r
+       - edit data/config.sql according to your config.tests.php\r
+       - install test database & users :\r
+               psql [...your options...]  -f data/ppatests_install.sql\r
+       - point your browser to http://your_server/path_to_ppa/tests/tests.php\r
+\r
+Howto clean:\r
+       - remove test database & users :\r
+               psql [...your options...] -f data/ppatests_install.sql\r
+\r
+\r
+General comments/tips for dev:\r
+       - using the web_tester, to click on a link with img + text, you have to $this->clickLink("[alt_txt] txt") where [alt_txt] is the alt text of the img tag.\r
+         see http://sourceforge.net/mailarchive/message.php?msg_id=41ACA535.1080406%40lastcraft.com\r
+\r
+Comments about tests:\r
+       Server tests :\r
+               TableSpacesTest.php :\r
+               - data/TableSpace must be empty and owned by your PgSQL admin user      \r
+               ReportsTest.php:\r
+               - see comments in testrun()\r
+       Database tests:\r
+               DatabaseTest.php:\r
+               - cannot delete datbases. Error : "can't delete opened database"\r
+               HelpTest.php:\r
+               - last assert fail because of the pg version in the link\r
+       Schemas tests:\r
+               TableTest.php:\r
+               - cannot edit & delete rows on viewtest because this table hasn't indexes.\r
+               display.php gives edit/delete links in tables have some "key".\r
+               viewtest is created by method createTable in Public/SetPrecondition.php\r
+\r
+\r
+\r
+\r
+OLD README PART\r
 \r
 \r
 Document History\r
index 5901f927ea942550741595ac6d39849940ef7159..32c8315f8297d58ba2d9400a11fd025b3f126094 100644 (file)
@@ -19,16 +19,13 @@ if(is_dir('../Public'))
  */
 class ExportTest extends PreconditionSet 
 {
-    // Declare the member variable for database name.
-    private $_databaseName = 'test';
-    
     function setUp()
     {
         global $webUrl;
         global $SUPER_USER_NAME;
         global $SUPER_USER_PASSWORD;
         
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
         
         return TRUE;
     }
@@ -48,11 +45,13 @@ class ExportTest extends PreconditionSet
      */
     function testServerDataCopyShow() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/all_db.php?action=export'));
+               $this->assertTrue($this->get("$webUrl/all_db.php", array(
+                       'action' => 'export',
+                       'server' => $SERVER))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'dataonly'));
@@ -61,7 +60,7 @@ class ExportTest extends PreconditionSet
        
         //Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['strexport']));
-        $this->assertWantedText('connect ' . $this->_databaseName);
+        $this->assertWantedText("connect $DATABASE");
         
         return TRUE;
     }
@@ -73,11 +72,13 @@ class ExportTest extends PreconditionSet
      */
     function testServerStructureSQLDownload() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/all_db.php?action=export'));
+               $this->assertTrue($this->get("$webUrl/all_db.php", array(
+                       'action' => 'export',
+                       'server' => $SERVER))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'structureonly'));
@@ -86,7 +87,7 @@ class ExportTest extends PreconditionSet
        
         //Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['strexport']));
-        $this->assertWantedText('connect ' . $this->_databaseName);
+        $this->assertWantedText("connect $DATABASE");
         
         return TRUE;
     }
@@ -97,12 +98,15 @@ class ExportTest extends PreconditionSet
      */
     function testDatabaseDataSQLShow() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/database.php?database=' . 
-                          $this->_databaseName . '&subject=database&action=export'));
+               $this->assertTrue($this->get("$webUrl/database.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'subject' => 'database',
+                       'action' => 'export'))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'dataonly'));
@@ -123,12 +127,15 @@ class ExportTest extends PreconditionSet
      */
     function testDatabaseStructureCOPYDownload() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/database.php?database=' . $this->_databaseName . 
-                                     '&subject=database&action=export'));
+               $this->assertTrue($this->get("$webUrl/database.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'subject' => 'database',
+                       'action' => 'export'))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'structureonly'));
@@ -151,12 +158,15 @@ class ExportTest extends PreconditionSet
      */
     function testTableDataShow() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the "Insert row" interface.
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confinsertrow' .
-                                     '&database=test&schema=public&table=student&'));
+               $this->assertTrue($this->get("$webUrl/tables.php", array(
+                       'action' => 'confinsertrow',
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => 'student'))
+               );
           
         // Set the value of the fields.                
         $this->assertTrue($this->setField('values[name]', 'testname'));
@@ -169,8 +179,14 @@ class ExportTest extends PreconditionSet
         $this->assertTrue($this->assertWantedText($lang['strrowinserted']));
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?database=' . $this->_databaseName . 
-                                     '&schema=public&table=student&subject=table&action=export'));
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => 'student',
+                       'subject' => 'table',
+                       'action' => 'export'))
+               );
         // Enter information for export the data.
         $this->assertTrue($this->setField('what', 'dataonly'));
         $this->assertTrue($this->setField('d_format', 'XML'));
@@ -182,8 +198,14 @@ class ExportTest extends PreconditionSet
         
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?database=' . $this->_databaseName . 
-                                     '&schema=public&table=student&subject=table&action=export'));
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => 'student',
+                       'subject' => 'table',
+                       'action' => 'export'))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'dataonly'));
@@ -195,8 +217,13 @@ class ExportTest extends PreconditionSet
         $this->assertWantedPattern('/testname/');
         
         // Empty the data in the table.
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_empty' . 
-                                     '&database=test&schema=public&table=student'));
+               $this->assertTrue($this->get("$webUrl/tables.php", array(
+                       'server' => $SERVER,
+                       'action' => 'confirm_empty',
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => 'student'))
+               );
         $this->assertTrue($this->clickSubmit($lang['strempty']));
 
         return TRUE;
@@ -209,12 +236,17 @@ class ExportTest extends PreconditionSet
      */
     function testTableStructureDataSQLDownload() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?database=' . $this->_databaseName .
-                                     '&schema=public&table=student&subject=table&action=export'));
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => 'student',
+                       'subject' => 'table',
+                       'action' => 'export'))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('what', 'structureanddata'));
@@ -234,12 +266,16 @@ class ExportTest extends PreconditionSet
      */
     function testViewStructureShow() 
     {
-        global $webUrl;
-        global $lang;
+        global $webUrl, $lang, $SERVER, $DATABASE;
         
         // Turn to the export data page.
-        $this->assertTrue($this->get($webUrl . '/viewproperties.php?database=' . $this->_databaseName . 
-                                     '&schema=pg_catalog&view=pg_user&subject=view&action=export'));
+        $this->assertTrue($this->get("$webUrl/viewproperties.php", array(
+                       'database' => $DATABASE,
+                       'schema' => 'pg_catalog',
+                       'view' => 'pg_user',
+                       'subject' => 'view',
+                       'action' => 'export'))
+               );
        
         // Enter information for exporting the data.
         $this->assertTrue($this->setField('s_clean', TRUE));
index 329b20a8ea0a4e97ba34273dbb5f86dbe2c6396b..e467d53b5b1c87e00a32970d50e274e0eec1c87d 100644 (file)
@@ -31,7 +31,7 @@ class ImportTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $SUPER_USER_PASSWORD;
         
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
         
         return TRUE;
     }
@@ -56,14 +56,19 @@ class ImportTest extends PreconditionSet
     function testXMLData() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER, $DATABASE;
         
         $this->_dataFilePath = getcwd() . '/../data/';
         
         // Turn to the import data page.
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?database=test' . 
-                                     '&schema=public&table=' . $this->_tableName . 
-                                     '&subject=table&action=import'));
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(
+                       'server' => $SERVER,
+                       'database' => $DATABASE,
+                       'schema' => 'public',
+                       'table' => $this->_tableName,
+                       'subject' => 'table',
+                       'action' => 'import'))
+               );
        
         // Enter information for importing the data.
         $this->assertTrue($this->setField('format', 'XML'));
@@ -86,13 +91,18 @@ class ImportTest extends PreconditionSet
     function testIncorectTxtData() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER, $DATABASE;
         
         $this->_dataFilePath = getcwd() . '/../data/';
         // Turn to the import data page.
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?database=test' . 
-                                     '&schema=public&table=' . $this->_tableName . 
-                                     '&subject=table&action=import'));
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(
+                                   'server' => $SERVER,
+                                               'database' => $DATABASE,
+                                               'schema' => 'public',
+                                               'table' => $this->_tableName,
+                                               'subject' => 'table',
+                                               'action' => 'import'))
+                                       );
        
         // Enter information for importing the data.
         $this->assertTrue($this->setField('format', $lang['strauto']));
@@ -112,10 +122,15 @@ class ImportTest extends PreconditionSet
     function emptyTable()
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER, $DATABASE;
         
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_empty' . 
-                                     '&database=test&schema=public&table=' . $this->_tableName));
+               $this->assertTrue($this->get("$webUrl/tables.php", array(
+                                   'server' => $SERVER,
+                                               'action' => 'confirm_empty',
+                                               'database' => $DATABASE,
+                                               'schema' => 'public',
+                                               'table' => $this->_tableName))
+                                       );
         $this->assertTrue($this->clickSubmit($lang['strempty']));
        
         return TRUE;
index e3de41d4ce9b0071172b902bd9bc991906fa7cc9..034d1a877d144c76856bfc0eb1fdc269e0933f99 100644 (file)
-<?php\r
-/**\r
- * Function area: Common manipulation\r
- * Sub function area: Security\r
- *\r
- * @author     Augmentum SpikeSource Team \r
- * @copyright  2005 by Augmentum, Inc.\r
- */\r
\r
-// Import the precondition class.\r
-if(is_dir('../Public')) \r
-{\r
-    require_once('../Public/SetPrecondition.php');\r
-}\r
-\r
-/**\r
- * This class is to test the security management.\r
- * It includes login/logout and modify password.\r
- */\r
-class SecurityTest extends PreconditionSet \r
-{\r
-    // Declare the member variables for the invalid username/password.\r
-    private $_invalidUserName = 'invalidusername';\r
-    private $_invalidPassword = 'invalidpassword';\r
-    \r
-    function setUp()\r
-    {  \r
-        return TRUE;\r
-    }\r
-    \r
-    \r
-    function tearDown()\r
-    {        \r
-        return TRUE;\r
-    }\r
-   \r
-   \r
-    /*\r
-     * TestCaseID: CSM01\r
-     * Test to login with special user name.\r
-     */\r
-    function testSpecialLogin() \r
-    {\r
-        global $webUrl;\r
-        global $NORMAL_USER_NAME;\r
-        global $lang;\r
-        \r
-        // Login with special user name "postgres".\r
-        $this->login('postgres', $this->_invalidPassword, $webUrl . '/index.php');\r
-        \r
-        // Verify the error messages.\r
-        $this->assertWantedText($lang['strlogindisallowed']);\r
-        $this->assertWantedText($lang['strviewfaq']);\r
-\r
-        // Login with special user name "postgres".\r
-        $this->login($NORMAL_USER_NAME, '', $webUrl . '/index.php');\r
-        \r
-        // Verify the error messages.\r
-        $this->assertWantedText($lang['strlogindisallowed']);\r
-        $this->assertWantedText($lang['strviewfaq']);\r
-        \r
-        return TRUE;\r
-    }\r
-    \r
-    \r
-    /*\r
-     * TestCaseID: CSM02\r
-     * Test to login with invalid user name or password.\r
-     */\r
-    function testInvalidLogin() \r
-    {\r
-        global $webUrl;\r
-        global $SUPER_USER_NAME;\r
-        global $lang;\r
-        \r
-        // Login with invalid user name.\r
-        $this->login($this->_invalidUserName, $this->_invalidPassword, $webUrl . '/index.php');\r
-        \r
-        // Verify the error messages.\r
-        $this->assertWantedText($lang['strloginfailed']);\r
-        \r
-        // Login with valid username and invalid password.\r
-        $this->login($SUPER_USER_NAME, $this->_invalidPassword, $webUrl . '/index.php');\r
-        \r
-        // Verify the error messages.\r
-        $this->assertWantedText($lang['strloginfailed']);\r
-        \r
-        return TRUE;\r
-    }\r
-    \r
-    \r
-    /*\r
-     * TestCaseID: CSM03\r
-     * Test to change the current user's password.\r
-     */\r
-    function testAccount() \r
-    {\r
-        global $webUrl;\r
-        global $NORMAL_USER_NAME;\r
-        global $NORMAL_USER_PASSWORD;\r
-        global $lang;\r
-        $newpassword = 'newpassword';\r
-        \r
-        $this->login($NORMAL_USER_NAME, $NORMAL_USER_PASSWORD, $webUrl . '/index.php');\r
-        \r
-        // Turn to the account page and change the password page.\r
-        $this->assertTrue($this->get($webUrl . '/users.php?action=account'));\r
-        $this->assertTrue($this->clickLink($lang['strchangepassword']));\r
-       \r
-        // Enter the new password and different confirm password.\r
-        $this->assertTrue($this->setField('password', $newpassword));\r
-        $this->assertTrue($this->setField('confirm', $this->_invalidPassword));\r
-       \r
-        // Then submit and verify the error messages.\r
-        $this->assertTrue($this->clickSubmit($lang['strok']));\r
-        $this->assertWantedText($lang['strpasswordconfirm']);\r
-        \r
-        // Enter the new password and confirm password.\r
-        $this->assertTrue($this->setField('password', $NORMAL_USER_PASSWORD));\r
-        $this->assertTrue($this->setField('confirm', $NORMAL_USER_PASSWORD));\r
-       \r
-        // Then submit and verify the messages.\r
-        $this->assertTrue($this->clickSubmit($lang['strok']));\r
-        $this->assertWantedText($lang['strpasswordchanged']);\r
-        \r
-        $this->logout();\r
-        \r
-        return TRUE;\r
-    }\r
-\r
-}\r
-?>\r
+<?php
+/**
+ * Function area: Common manipulation
+ * Sub function area: Security
+ *
+ * @author     Augmentum SpikeSource Team 
+ * @copyright  2005 by Augmentum, Inc.
+ */
+// Import the precondition class.
+if(is_dir('../Public')) 
+{
+    require_once('../Public/SetPrecondition.php');
+}
+
+/**
+ * This class is to test the security management.
+ * It includes login/logout and modify password.
+ */
+class SecurityTest extends PreconditionSet 
+{
+    // Declare the member variables for the invalid username/password.
+    private $_invalidUserName = 'invalidusername';
+    private $_invalidPassword = 'invalidpassword';
+    
+    function setUp()
+    {  
+        return TRUE;
+    }
+    
+    
+    function tearDown()
+    {        
+        return TRUE;
+    }
+   
+   
+    /*
+     * TestCaseID: CSM01
+     * Test to login with special user name.
+     */
+    function testSpecialLogin() 
+    {
+        global $webUrl;
+        global $NORMAL_USER_NAME;
+        global $lang;
+        
+        // Login with special user name "postgres".
+        $this->login('postgres', $this->_invalidPassword, "$webUrl/login.php");
+        
+        // Verify the error messages.
+        $this->assertWantedText($lang['strlogindisallowed']);
+        $this->assertWantedText($lang['strviewfaq']);
+
+        // Login with special user name "postgres".
+        $this->login($NORMAL_USER_NAME, '', "$webUrl/login.php");
+        
+        // Verify the error messages.
+        $this->assertWantedText($lang['strlogindisallowed']);
+        $this->assertWantedText($lang['strviewfaq']);
+        
+        return TRUE;
+    }
+    
+    
+    /*
+     * TestCaseID: CSM02
+     * Test to login with invalid user name or password.
+     */
+    function testInvalidLogin() 
+    {
+        global $webUrl;
+        global $SUPER_USER_NAME;
+        global $lang;
+        
+        // Login with invalid user name.
+        $this->login($this->_invalidUserName, $this->_invalidPassword, "$webUrl/login.php");
+        
+        // Verify the error messages.
+        $this->assertWantedText($lang['strloginfailed']);
+        
+        // Login with valid username and invalid password.
+        $this->login($SUPER_USER_NAME, $this->_invalidPassword, "$webUrl/login.php");
+        
+        // Verify the error messages.
+        $this->assertWantedText($lang['strloginfailed']);
+        
+        return TRUE;
+    }
+    
+    
+    /*
+     * TestCaseID: CSM03
+     * Test to change the current user's password.
+     */
+    function testAccount() 
+    {
+        global $webUrl;
+        global $NORMAL_USER_NAME;
+        global $NORMAL_USER_PASSWORD;
+        global $lang, $SERVER;
+        $newpassword = 'newpassword';
+        
+        $this->login($NORMAL_USER_NAME, $NORMAL_USER_PASSWORD, "$webUrl/login.php");
+        
+        // Turn to the account page and change the password page.
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER, 'action' => 'account')));
+        $this->assertTrue($this->clickLink($lang['strchangepassword']));
+       
+        // Enter the new password and different confirm password.
+        $this->assertTrue($this->setField('password', $newpassword));
+        $this->assertTrue($this->setField('confirm', $this->_invalidPassword));
+       
+        // Then submit and verify the error messages.
+        $this->assertTrue($this->clickSubmit($lang['strok']));
+        $this->assertWantedText($lang['strpasswordconfirm']);
+        
+        // Enter the new password and confirm password.
+        $this->assertTrue($this->setField('password', $NORMAL_USER_PASSWORD));
+        $this->assertTrue($this->setField('confirm', $NORMAL_USER_PASSWORD));
+       
+        // Then submit and verify the messages.
+        $this->assertTrue($this->clickSubmit($lang['strok']));
+        $this->assertWantedText($lang['strpasswordchanged']);
+        
+        $this->logout();
+        
+        return TRUE;
+    }
+
+}
+?>
index f8218aa312d1d7efa402439f89cc5e3db3f74ba3..4b86bdac492873e9d91bb0c7472496faa8db70c3 100644 (file)
-<?php\r
-/**\r
- * Function area     : Database.\r
- * Sub Function area : Admin.\r
- * \r
- * @author     Augmentum SpikeSource Team\r
- * @copyright  Copyright (c) 2005 by Augmentum, Inc.\r
- */\r
-\r
-// Import the precondition class.\r
-if (is_dir('../Public'))\r
-{\r
-    require_once('../Public/SetPrecondition.php');\r
-} \r
-\r
-/**\r
- * This class is to test the Admin about PostgreSql implementation.\r
- */\r
-\r
-class AdminTest extends PreconditionSet\r
-{\r
-    /**\r
-     * Set up the preconditon.\r
-     */\r
-    function setUp()\r
-    {\r
-        global $webUrl;\r
-        global $SUPER_USER_NAME;\r
-        global $SUPER_USER_PASSWORD;\r
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-                     $webUrl . '/index.php');\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * Release the relational resource.\r
-     */\r
-    function tearDown()\r
-    {\r
-        // Logout this system.\r
-        $this->logout();\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DAV001\r
-     * This test is used to test the admin about Vacuum and full.\r
-     */\r
-    function testAdminVacuumAna()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-        \r
-        // Locate the list page of admin.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test' .\r
-                                     '&subject=database' . '&action=admin'));\r
-        $this->assertTrue($this->setField('vacuum_analyze', TRUE));\r
-        $this->assertTrue($this->setField('vacuum_full', TRUE));\r
-        $this->assertTrue($this->clickSubmit($lang['strvacuum']));\r
-        $this->assertWantedText($lang['strvacuumgood']);\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DCS002\r
-     * This test is used to test the admin about freeze.\r
-     */\r
-    function testAdminFreeze()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-        \r
-        // Locate the list page of admin.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test' .\r
-                                     '&subject=database&action=admin'));\r
-        $this->assertTrue($this->setField('vacuum_freeze', TRUE));\r
-        $this->assertTrue($this->clickSubmit($lang['strvacuum']));\r
-        $this->assertWantedText($lang['strvacuumgood']);\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DCS003\r
-     * This test is used to test the admin about Analyze.\r
-     */\r
-    function testAdminAnalyze()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-        \r
-        // Locate the list page of admin.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=admin'));\r
-        $this->assertTrue($this->clickSubmit($lang['stranalyze']));\r
-        $this->assertWantedText($lang['stranalyzegood']);\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DCS004\r
-     * This test is used to test the admin about Cluster.\r
-     */\r
-    function testAdminCluster()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-        \r
-        // Locate the list page of admin.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=admin'));\r
-        $this->assertTrue($this->clickSubmit($lang['strcluster']));\r
-        $this->assertWantedText($lang['strclusteredgood']);\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DCS005\r
-     * This test is used to test the admin about Reindex.\r
-     */\r
-    function testAdminReindex()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-\r
-        // Locate the list page of admin.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=admin'));\r
-        $this->assertTrue($this->setField('reindex_force', TRUE));\r
-        $this->assertTrue($this->clickSubmit($lang['strreindex']));\r
-        $this->assertWantedText($lang['strreindexgood']);\r
-\r
-        return TRUE;\r
-    }\r
-}\r
-\r
-?>\r
+<?php
+/**
+ * Function area     : Database.
+ * Sub Function area : Admin.
+ * 
+ * @author     Augmentum SpikeSource Team
+ * @copyright  Copyright (c) 2005 by Augmentum, Inc.
+ */
+
+// Import the precondition class.
+if (is_dir('../Public'))
+{
+    require_once('../Public/SetPrecondition.php');
+} 
+
+/**
+ * This class is to test the Admin about PostgreSql implementation.
+ */
+
+class AdminTest extends PreconditionSet
+{
+    /**
+     * Set up the preconditon.
+     */
+    function setUp()
+    {
+        global $webUrl;
+        global $SUPER_USER_NAME;
+        global $SUPER_USER_PASSWORD;
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,
+                     "$webUrl/login.php");
+
+        return TRUE;
+    }
+
+
+    /**
+     * Release the relational resource.
+     */
+    function tearDown()
+    {
+        // Logout this system.
+        $this->logout();
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DAV001
+     * This test is used to test the admin about Vacuum and full.
+     */
+    function testAdminVacuumAna()
+    {
+        global $webUrl, $lang, $SERVER, $DATABASE;
+        
+        // Locate the list page of admin.
+               $this->assertTrue($this->get("$webUrl/database.php",
+                       array('database' => $DATABASE,
+                               'subject' => 'database',
+                               'action' => 'admin',
+                               'server' => $SERVER))
+               );
+        $this->assertTrue($this->setField('vacuum_analyze', TRUE));
+        $this->assertTrue($this->setField('vacuum_full', TRUE));
+        $this->assertTrue($this->clickSubmit($lang['strvacuum']));
+        $this->assertWantedText($lang['strvacuumgood']);
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DCS002
+     * This test is used to test the admin about freeze.
+     */
+    function testAdminFreeze()
+    {
+        global $webUrl, $lang, $SERVER, $DATABASE;
+        
+        // Locate the list page of admin.
+               $this->assertTrue($this->get("$webUrl/database.php",
+                       array('database' => $DATABASE,
+                               'subject' => 'database',
+                               'action' => 'admin',
+                               'server' => $SERVER))
+               );
+        $this->assertTrue($this->setField('vacuum_freeze', TRUE));
+        $this->assertTrue($this->clickSubmit($lang['strvacuum']));
+        $this->assertWantedText($lang['strvacuumgood']);
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DCS003
+     * This test is used to test the admin about Analyze.
+     */
+    function testAdminAnalyze()
+    {
+        global $webUrl, $lang, $SERVER, $DATABASE;
+        
+        // Locate the list page of admin.
+               $this->assertTrue($this->get("$webUrl/database.php",
+                       array('database' => $DATABASE,
+                               'subject' => 'database',
+                               'action' => 'admin',
+                               'server' => $SERVER))
+               );
+        $this->assertTrue($this->clickSubmit($lang['stranalyze']));
+        $this->assertWantedText($lang['stranalyzegood']);
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DCS004
+     * This test is used to test the admin about Cluster.
+     */
+    function testAdminCluster()
+    {
+        global $webUrl, $lang, $SERVER, $DATABASE;
+        
+        // Locate the list page of admin.
+               $this->assertTrue($this->get("$webUrl/database.php", array(
+                               'server' => $SERVER,
+                               'database' => $DATABASE,
+                               'subject' => 'database',
+                               'action' => 'admin'))
+               );
+        $this->assertTrue($this->clickSubmit($lang['strcluster']));
+        $this->assertWantedText($lang['strclusteredgood']);
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DCS005
+     * This test is used to test the admin about Reindex.
+     */
+    function testAdminReindex()
+    {
+        global $webUrl, $lang, $SERVER, $DATABASE;
+
+        // Locate the list page of admin.
+               $this->assertTrue($this->get("$webUrl/database.php", array(
+                               'database' => $DATABASE,
+                               'subject' => 'database',
+                               'action' => 'admin',
+                               'server' => $SERVER))
+               );
+        $this->assertTrue($this->setField('reindex_force', TRUE));
+        $this->assertTrue($this->clickSubmit($lang['strreindex']));
+        $this->assertWantedText($lang['strreindexgood']);
+
+        return TRUE;
+    }
+}
+
+?>
index 1c8ea2ede1001a1235b8f1ec0bca8a2cc55b01e0..c07ccadd6a4ce782ee0d7686df613544e3685a9c 100644 (file)
@@ -1,72 +1,75 @@
-<?php\r
-/**\r
- * Function area     : Database.\r
- * Sub Function area : Casts.\r
- * \r
- * @author     Augmentum SpikeSource Team\r
- * @copyright  Copyright (c) 2005 by Augmentum, Inc.\r
- */\r
-\r
-// Import the precondition class.\r
-if (is_dir('../Public'))\r
-{\r
-    require_once('../Public/SetPrecondition.php');\r
-}\r
-\r
-/**\r
- * This class is to test the Casts displayed list.\r
- */\r
-class CastsTest extends PreconditionSet\r
-{\r
-    /**\r
-     * Set up the preconditon.\r
-     */\r
-    function setUp()\r
-    {\r
-        global $webUrl;\r
-        global $SUPER_USER_NAME;\r
-        global $SUPER_USER_PASSWORD;\r
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-                     $webUrl . '/index.php');\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * Release the relational resource.\r
-     */\r
-    function tearDown()\r
-    {\r
-        // Logout this system.\r
-        $this->logout();\r
-\r
-        return TRUE;\r
-    }\r
-\r
-\r
-    /**\r
-     * TestCaseId: DLU001\r
-     * This test is used to test Casts Displayed page.\r
-     *\r
-     * Note: It's strange here, because it only display one sentecse.\r
-     */\r
-    function testLanguage()\r
-    {\r
-        global $webUrl;\r
-        global $lang;\r
-\r
-        // Locate the list page of language.\r
-        $this->assertTrue($this->get($webUrl . '/casts.php?database=test' .\r
-                                     '&subject=database'));\r
-\r
-        $this->assertWantedText($lang['strsourcetype']);\r
-        $this->assertWantedText($lang['strtargettype']);\r
-        $this->assertWantedText($lang['strimplicit']);\r
-        \r
-\r
-        return TRUE;\r
-    }\r
-}\r
-\r
-?>\r
+<?php
+/**
+ * Function area     : Database.
+ * Sub Function area : Casts.
+ * 
+ * @author     Augmentum SpikeSource Team
+ * @copyright  Copyright (c) 2005 by Augmentum, Inc.
+ */
+
+// Import the precondition class.
+if (is_dir('../Public'))
+{
+    require_once('../Public/SetPrecondition.php');
+}
+
+/**
+ * This class is to test the Casts displayed list.
+ */
+class CastsTest extends PreconditionSet
+{
+    /**
+     * Set up the preconditon.
+     */
+    function setUp()
+    {
+        global $webUrl;
+        global $SUPER_USER_NAME;
+        global $SUPER_USER_PASSWORD;
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,
+                     "$webUrl/login.php");
+
+        return TRUE;
+    }
+
+
+    /**
+     * Release the relational resource.
+     */
+    function tearDown()
+    {
+        // Logout this system.
+        $this->logout();
+
+        return TRUE;
+    }
+
+
+    /**
+     * TestCaseId: DLU001
+     * This test is used to test Casts Displayed page.
+     *
+     * Note: It's strange here, because it only display one sentecse.
+     */
+    function testLanguage()
+    {
+        global $webUrl;
+        global $lang, $SERVER, $DATABASE;
+
+        // Locate the list page of language.
+               $this->assertTrue($this->get("$webUrl/casts.php", array(
+                                   'server' => $SERVER,
+                                               'database' => $DATABASE,
+                                               'subject' => 'database'))
+                                       );
+
+        $this->assertWantedText($lang['strsourcetype']);
+        $this->assertWantedText($lang['strtargettype']);
+        $this->assertWantedText($lang['strimplicit']);
+        
+
+        return TRUE;
+    }
+}
+
+?>
index 1d18ffc161aa64a32a12cd6bfe30e92bd2f505f0..c0a013f459e9363ae735a6ef42c3443d9815d037 100644 (file)
@@ -1,48 +1,48 @@
-<?php\r
-/**\r
- * Function area     : Database.\r
- * This is group test file for database.\r
- *\r
- * @author     Augmentum SpikeSource Team\r
- * @copyright  Copyright (c) 2005 by Augmentum, Inc.\r
- */\r
-\r
- require_once ('DatabaseTest.php');\r
- require_once ('SqlTest.php');\r
- require_once ('FindObjectsTest.php');\r
- require_once ('VariablesTest.php');\r
- require_once ('SchemaBasicTest.php');\r
- require_once ('AdminTest.php');\r
- require_once ('ProcessesTest.php');\r
- require_once ('LanguageTest.php');\r
- require_once ('CastsTest.php');\r
- require_once ('HelpTest.php');\r
-\r
-\r
-/**\r
- * Run all the test cases as one group.\r
- */\r
- class DatabaseGroupTest extends GroupTest\r
- {\r
-    function DatabaseGroupTest()\r
-    {\r
-        $this->GroupTest('Database group test begins.');\r
-\r
-        /*\r
-         * Hides it temporary.\r
-         * $this->addTestClass(new TableTest());\r
-         */\r
-        $this->addTestClass(new SqlTest());\r
-        $this->addTestClass(new DatabaseTest());\r
-        $this->addTestClass(new FindObjectsTest());\r
-        $this->addTestClass(new VariablesTest());\r
-        $this->addTestClass(new SchemaBasicTest());\r
-        $this->addTestClass(new AdminTest());\r
-        $this->addTestClass(new ProcessesTest());\r
-        $this->addTestClass(new LanguageTest());\r
-        $this->addTestClass(new CastsTest());\r
-        $this->addTestClass(new HelpTest());\r
-    }\r
- }\r
-\r
-?>\r
+<?php
+/**
+ * Function area     : Database.
+ * This is group test file for database.
+ *
+ * @author     Augmentum SpikeSource Team
+ * @copyright  Copyright (c) 2005 by Augmentum, Inc.
+ */
+
+ require_once ('DatabaseTest.php');
+ require_once ('SqlTest.php');
+ require_once ('FindObjectsTest.php');
+ require_once ('VariablesTest.php');
+ require_once ('SchemaBasicTest.php');
+ require_once ('AdminTest.php');
+ require_once ('ProcessesTest.php');
+ require_once ('LanguageTest.php');
+ require_once ('CastsTest.php');
+ require_once ('HelpTest.php');
+
+
+/**
+ * Run all the test cases as one group.
+ */
+ class DatabaseGroupTest extends GroupTest
+ {
+    function DatabaseGroupTest()
+    {
+        $this->GroupTest('Database group test begins.');
+
+        /*
+         * Hides it temporary.
+         * $this->addTestClass(new TableTest());
+         */
+        $this->addTestClass(new SqlTest());
+        $this->addTestClass(new DatabaseTest());
+        $this->addTestClass(new FindObjectsTest());
+        $this->addTestClass(new VariablesTest());
+        $this->addTestClass(new SchemaBasicTest());
+        $this->addTestClass(new AdminTest());
+        $this->addTestClass(new ProcessesTest());
+        $this->addTestClass(new LanguageTest());
+        $this->addTestClass(new CastsTest());
+               $this->addTestClass(new HelpTest());
+    }
+ }
+
+?>
index e25ca754af39a9af546450111c1d9e91fa33a210..05150a47c0793b89a944a1312d9d45d5c8d37b9d 100644 (file)
@@ -28,7 +28,7 @@ class DatabaseTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
         \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
                      \r
         return TRUE;                     \r
     } \r
@@ -58,13 +58,16 @@ class DatabaseTest extends PreconditionSet
     function testCreateLATIN1DBInSPT()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/all_db.php'));\r
+        $this->assertTrue($this->get("$webUrl/all_db.php"));\r
 \r
         // Click the hyperlink of "Create Database".\r
-        $this->assertTrue($this->get($webUrl . '/all_db.php?action=create'));\r
+               $this->assertTrue($this->get("$webUrl/all_db.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create'))\r
+                                       );\r
 \r
         // Fill the form about creating database.\r
         $this->assertTrue($this->setfield('formName', 'spikesource1'));\r
@@ -81,7 +84,8 @@ class DatabaseTest extends PreconditionSet
         $this->assertWantedText($lang['strdatabasecreated']);\r
 \r
         // Release the resource. \r
-        // In fact, this line doesnot work because of phpPgAdmin's bug.\r
+               // XXX In fact, this line doesnot work because of phpPgAdmin's bug.\r
+               // "cannot delete opened database"\r
         $this->dropDatabase('spikesource1');\r
 \r
         return TRUE;\r
@@ -100,19 +104,22 @@ class DatabaseTest extends PreconditionSet
     function testCreateUNICODEDBInTester()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         \r
         // Sleep for a while to wait for the template1 to be available\r
         sleep(20);\r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/all_db.php'));\r
+        $this->assertTrue($this->get("$webUrl/all_db.php"));\r
 \r
         // Click the hyperlink of "Create Database".\r
-        $this->assertTrue($this->get($webUrl . '/all_db.php?action=create'));\r
+               $this->assertTrue($this->get("$webUrl/all_db.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create'))\r
+                                       );\r
 \r
         // Fill the form about creating database.\r
         $this->assertTrue($this->setfield('formName', 'spikesource2'));\r
-        $this->assertTrue($this->setfield('formEncoding', 'UNICODE'));\r
+        $this->assertTrue($this->setfield('formEncoding', 'UTF8'));\r
         $this->assertTrue($this->setfield('formSpc', 'pg_default'));\r
         \r
         // Click the submit button.\r
@@ -125,7 +132,8 @@ class DatabaseTest extends PreconditionSet
         $this->assertWantedText($lang['strdatabasecreated']);\r
 \r
         // Release the resource.\r
-        // In fact, this line doesnot work because of phpPgAdmin's bug.\r
+               // XXX In fact, this line doesnot work because of phpPgAdmin's bug (?)\r
+               // "cannot delete opened database"\r
         $this->dropDatabase('spikesource2');\r
 \r
         return TRUE;\r
@@ -142,12 +150,16 @@ class DatabaseTest extends PreconditionSet
     function testDropDatabase()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
         // Click the hyperlink of "Create Database".\r
-        $this->assertTrue($this->get($webUrl . '/all_db.php' .\r
-                                     '?action=confirm_drop' .\r
-                                     '&subject=database&database=test&'));\r
+               $this->assertTrue($this->get("$webUrl/all_db.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'subject' => 'database',\r
+                                               'database' => $DATABASE,\r
+                                               'dropdatabase' => $DATABASE ))\r
+                                       );\r
 \r
         // Click the submit button "Drop" next page.\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
@@ -156,7 +168,7 @@ class DatabaseTest extends PreconditionSet
         // There is an issue about PostgreSQL.  So let me difine the displayed text.\r
         $this->assertWantedText($lang['strdatabasedropped']);\r
 \r
-        // Release the resource.  The lines below failed in deed.\r
+        // XXX Release the resource.  The lines below failed in deed. (can't delete opened db)\r
         $this->dropDatabase('SpikeSource1');\r
         $this->dropDatabase('SpikeSource2');\r
 \r
@@ -165,4 +177,3 @@ class DatabaseTest extends PreconditionSet
 }\r
 \r
 ?>\r
-\r
index 3c3207a5cda481c817ecf4cfa4142e706407c755..dc06afb92cf931d1337238b877956f61fe22532e 100644 (file)
@@ -27,7 +27,7 @@ class FindObjectsTest extends PreconditionSet
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -51,12 +51,15 @@ class FindObjectsTest extends PreconditionSet
     function testSimpleFindObject()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                      '?database=test&subject=database' .\r
-                                      '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'find'))\r
+               );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'All objects'));\r
@@ -72,102 +75,135 @@ class FindObjectsTest extends PreconditionSet
     function testFindObjsInSchemas()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+            'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'find'))\r
+               );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Schemas'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Tables'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Views'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'subject' => 'database',\r
+                                          'action' => 'find'))\r
+                                  );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Sequences'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Columns'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Rules'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'subject' => 'database',\r
+                                          'action' => 'find'))\r
+                                  );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Indexes'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'subject' => 'database',\r
+                                          'action' => 'find'))\r
+                                  );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Triggers'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Constraints'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Functions'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=find'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'find'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('term', 'student'));\r
         $this->assertTrue($this->setField('filter', 'Domains'));\r
@@ -184,12 +220,15 @@ class FindObjectsTest extends PreconditionSet
     function testFindTopObjects()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
         // Locate the list page of databases.\r
-        $this->assertTrue($this->get($webUrl . '/sqledit.php?action=find&'));\r
+               $this->assertTrue($this->get("$webUrl/sqledit.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'find'))\r
+               );\r
 \r
-        $this->assertTrue($this->setField('database', 'test'));\r
+        $this->assertTrue($this->setField('database', $DATABASE));\r
         $this->assertTrue($this->setField('term', 'All objects'));\r
         $this->assertTrue($this->clickSubmit ($lang['strfind']));\r
         return true;\r
index 65717919e9e718cd52647bddc8362b761cd6274f..7392b3b8c37027d53ddda0ee8ebaf77eb204149c 100644 (file)
@@ -29,7 +29,7 @@ class HelpTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-            $webUrl . '/index.php');\r
+            "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -57,16 +57,19 @@ class HelpTest extends PreconditionSet
     function testHelpWithInnerSchema()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
         // Locate the list page of database.\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'subject' => 'database'))\r
+                                  );\r
 \r
         // Click the link about help.\r
-        $this->assertTrue($this->get($webUrl . '/help.php'));\r
-        $this->assertTrue($this->get($webUrl . '/help.php?help=pg.schema'));\r
-        $this->assertTrue($this->get($webUrl . '/help.php?help=pg.column.add'));\r
+        $this->assertTrue($this->get("$webUrl/help.php"));\r
+        $this->assertTrue($this->get("$webUrl/help.php?help=pg.schema"));\r
+        $this->assertTrue($this->get("$webUrl/help.php?help=pg.column.add"));\r
 \r
         // Comment this for avoiding error by Xdebug.\r
         // Becase we cannot assert something about the content of the page via\r
@@ -83,14 +86,19 @@ class HelpTest extends PreconditionSet
      */\r
     function testHelpWithInrClk()\r
     {\r
-        global $webUrl;\r
+        global $webUrl, $SERVER, $DATABASE;\r
 \r
         // Locate the list page of language.\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database'));\r
-        $this->assertTrue($this->get($webUrl . '/help.php'));        \r
-        \r
-        $this->assertTrue($this->clickLink('http://www.postgresql.org/docs/8.0/' .\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database'))\r
+               );\r
+\r
+        $this->assertTrue($this->get("$webUrl/help.php", array('server' => $SERVER)));        \r
+\r
+               // XXX fail because of the version number in the URL\r
+               $this->assertTrue($this->clickLink(/*'http://www.postgresql.org/docs/8.0/' .*/\r
                                            'interactive/sql-expressions.html' .\r
                                            '#SQL-SYNTAX-TYPE-CASTS'));\r
 \r
index 208727d9491606ba9f3791357d46d0bd712f929d..8938df23d6324a66ef8d40ca8a45131b44ee0f63 100644 (file)
@@ -29,7 +29,7 @@ class LanguageTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -53,10 +53,14 @@ class LanguageTest extends PreconditionSet
      */\r
     function testLanguage()\r
     {\r
-        global $webUrl;\r
+               global $webUrl, $SERVER, $DATABASE;\r
+\r
         // Locate the list page of language.\r
-        $this->assertTrue($this->get($webUrl . '/languages.php' .\r
-                                     '?database=test&subject=database'));\r
+               $this->assertTrue($this->get("$webUrl/languages.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database'))\r
+                                       );\r
 \r
         $this->assertWantedPattern('/sql/');\r
 \r
index b8df5ffa2900076d2d9272a4de2b8997396f36ed..3400710587571d6db09175dc31c784aef312c3c2 100644 (file)
@@ -28,7 +28,7 @@ class ProcessesTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-            $webUrl . '/index.php');\r
+            "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -55,11 +55,14 @@ class ProcessesTest extends PreconditionSet
     function testProcesses()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?database=test&subject=database' .\r
-                                     '&action=processes'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'subject' => 'database',\r
+                                          'action' => 'processes'))\r
+                                  );\r
 \r
         $this->assertWantedText($lang['strnodata']);\r
 \r
index 65f191808c055a35f4c3e0b4d02ea8acf1b0e2b5..73af3ef4908968dfd82841e7e635c03d2aa39437 100644 (file)
@@ -30,7 +30,7 @@ class SchemaBasicTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-            $webUrl . '/index.php');\r
+            "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -54,16 +54,22 @@ class SchemaBasicTest extends PreconditionSet
      */\r
     function testCreateBasSchema()\r
     {\r
-        global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database'));\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&action=create'));\r
+        global $webUrl, $SUPER_USER_NAME;\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database'))\r
+                                       );\r
+               $this->assertTrue($this->get("$webUrl/schemas.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'action' => 'create'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('formName', 'testSchemaName'));\r
-        $this->assertTrue($this->setField('formAuth', 'super'));\r
+        $this->assertTrue($this->setField('formAuth', $SUPER_USER_NAME));\r
         $this->assertTrue($this->setField('formComment',\r
                                           'Comment of test schema.'));\r
 \r
@@ -82,17 +88,29 @@ class SchemaBasicTest extends PreconditionSet
     function testAlterBasSchema()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database'));\r
-        $this->assertTrue($this->get($webUrl . '/redirect.php?section=database' .\r
-                                     '&database=test&'));\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database'));\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?action=alter_schema' .\r
-                                     '&database=test&schema=testSchemaName&'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database'))\r
+               );\r
+               $this->assertTrue($this->get("$webUrl/redirect.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'section' => 'database',\r
+                                               'database' => $DATABASE))\r
+               );\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database'))\r
+               );\r
+               $this->assertTrue($this->get("$webUrl/schemas.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'alter',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'testSchemaName'))\r
+               );\r
 \r
         $this->assertTrue($this->setField('comment',\r
                                           'The comment has been changed.'));\r
@@ -111,15 +129,24 @@ class SchemaBasicTest extends PreconditionSet
     function testDropBasSchema()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database'));\r
-        $this->assertTrue($this->get($webUrl . '/redirect.php' .\r
-                                     '?section=database&database=test&'));\r
-        $this->assertTrue($this->get($webUrl . '/database.php' .\r
-                                     '?action=confirm_drop&database=test' .\r
-                                     '&schema=testSchemaName&'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database'))\r
+               );\r
+               $this->assertTrue($this->get("$webUrl/redirect.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'section' => 'database',\r
+                                               'database' => $DATABASE))\r
+               );\r
+               $this->assertTrue($this->get("$webUrl/schemas.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'testSchemaName'))\r
+               );\r
 \r
         $this->assertTrue($this->setField('cascade', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
index 4750a3c7aead577fea2edf5ab8cc58eb026a5fbb..c9930c28eb49aa4fe9b72df6825f83115820c508 100644 (file)
@@ -27,7 +27,7 @@ class SqlTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-            $webUrl . '/index.php');\r
+            "$webUrl/login.php");\r
 \r
         return TRUE;\r
     }\r
@@ -53,13 +53,17 @@ class SqlTest extends PreconditionSet
     function testSimpleSelectSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", \r
+                       array('database' => $DATABASE,\r
+                               'subject' => 'database',\r
+                               'action' => 'sql',\r
+                               'server' => $SERVER))\r
+               );\r
         $this->assertTrue($this->setFieldById(0, "select id from student;"));\r
         \r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         return TRUE;\r
     }\r
@@ -73,13 +77,17 @@ class SqlTest extends PreconditionSet
     function testSimpleDeleteSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
         $this->assertTrue($this->setField('query', 'delete from "student";'));\r
         \r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         return TRUE;\r
     }\r
@@ -92,16 +100,20 @@ class SqlTest extends PreconditionSet
     function testSimpleInsertSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
         $this->assertTrue($this->setField('query',\r
                                           "insert into studen t values " .\r
                                           "(nextval('public.student_id_seq'::text)" .\r
                                           ", 'test2', now(), 'test2 is a student.');"));\r
         \r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         return true;\r
     }\r
@@ -115,15 +127,19 @@ class SqlTest extends PreconditionSet
     function testSimpleUpdateSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'database' => $DATABASE,\r
+                       'server' => $SERVER,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
         $this->assertTrue($this->setField('query',\r
                                           'update public."student" ' .\r
                                           'set "birthday" = now();'));\r
         \r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         return TRUE;\r
     }\r
@@ -137,10 +153,14 @@ class SqlTest extends PreconditionSet
     function testExplain()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
 \r
         $this->assertTrue($this->setField('query',\r
                                           'select "id" from "student";'));\r
@@ -165,10 +185,14 @@ class SqlTest extends PreconditionSet
     function testExplainAnalyze()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'database' => $DATABASE,\r
+                       'server' => $SERVER,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
         $this->assertTrue($this->setField('query',\r
                                           'select "id" from "student";'));\r
 \r
@@ -176,12 +200,10 @@ class SqlTest extends PreconditionSet
 \r
         $this->assertTrue($this->clickSubmit($lang['strexplainanalyze']));\r
 \r
-\r
         // Here $lang['strsqlexecuted'] is not fit for this situation. Because the "%s"\r
         // make the assertion failed.\r
         $this->assertWantedText('Total runtime');\r
 \r
-\r
         return TRUE;\r
     }\r
 \r
@@ -198,19 +220,22 @@ class SqlTest extends PreconditionSet
     {\r
 \r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl . '/database.php?' . \r
-                                     'database=test&subject=database' .\r
-                                     '&action=sql'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'subject' => 'database',\r
+                       'action' => 'sql'))\r
+               );\r
 \r
         $webServerUrl = getcwd();\r
-        $sqlScriptUrl = $webServerUrl . "/../data/select.sql";\r
+        $sqlScriptUrl = getcwd() . "/data/select.sql";\r
 \r
         $this->assertTrue ($this->setField('script', $sqlScriptUrl));\r
 \r
-        // This should be failed.  Because the SimpleText doesn't support\r
-        // upload yet.\r
+               $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
+\r
         $this->assertWantedText($lang['strsqlexecuted']);\r
 \r
         return TRUE;\r
@@ -225,14 +250,14 @@ class SqlTest extends PreconditionSet
     function testSelectTopSQL()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->get($webUrl . '/sqledit.php?action=sql&');\r
+        $this->get("$webUrl/sqledit.php", array('action' => 'sql', 'server' => $SERVER));\r
 \r
-        $this->assertTrue($this->setField('database', 'test'));\r
+        $this->assertTrue($this->setField('database', $DATABASE));\r
         $this->assertTrue($this->setField('query', 'select * from student;'));\r
 \r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         $this->assertWantedText($lang['strsqlexecuted']);\r
 \r
@@ -248,14 +273,14 @@ class SqlTest extends PreconditionSet
     function testResultFromSelectTopSQL()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->get($webUrl . '/sqledit.php?action=sql&');\r
+        $this->get("$webUrl/sqledit.php", array('action' => 'sql', 'server' => $SERVER));\r
 \r
-        $this->assertTrue($this->setField('database', 'test'));\r
+        $this->assertTrue($this->setField('database', $DATABASE));\r
         $this->assertTrue($this->setField('query', 'select * from student;'));\r
         $this->assertTrue($this->setField('paginate', TRUE));\r
-        $this->assertTrue($this->clickSubmit($lang['strgo']));\r
+        $this->assertTrue($this->clickSubmit($lang['strexecute']));\r
 \r
         $this->assertTrue($this->clickLink($lang['strexpand']));\r
         $this->assertWantedText($lang['strnodata']);\r
@@ -277,14 +302,17 @@ class SqlTest extends PreconditionSet
     function testReportByTopSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl .\r
-                                     '/reports.php?action=create&db_name=test' .\r
-                                     '&report_sql=select+id+from+student%3B'));\r
+               $this->assertTrue($this->get("$webUrl/reports.php", array(\r
+                       'action' => 'create',\r
+                       'server' => $SERVER,\r
+                       'db_name' => $DATABASE,\r
+                       'report_sql' => 'select id from student;')\r
+               ));\r
 \r
-        $this->assertTrue($this->setField('report_name', 'test'));\r
-        $this->assertTrue($this->setField('descr', 'test'));\r
+        $this->assertTrue($this->setField('report_name', 'ppasimpletestreport'));\r
+        $this->assertTrue($this->setField('descr', 'ppasimpletest tests'));\r
 \r
         $this->assertTrue($this->clickSubmit($lang['strsave']));\r
 \r
@@ -300,11 +328,13 @@ class SqlTest extends PreconditionSet
     function testDownloadTopSql()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl .\r
-                                     '/dataexport.php?query=select+id+from+student%3B' .\r
-                                     '&database=test'));\r
+               $this->assertTrue($this->get("$webUrl/dataexport.php", array(\r
+                       'server' => $SERVER,\r
+                       'query' => 'select+id+from+student%3B',\r
+                       'database' => $DATABASE))\r
+               );\r
 \r
         $this->assertTrue($this->setField('d_format', 'XML'));\r
         $this->assertTrue($this->setField('output', 'show'));\r
index 029fdfab3f86074319594c24b921c3e49e6046dc..cb4ea7de2d56478284ab9749c9664f2dbbd0cbd7 100644 (file)
@@ -28,7 +28,7 @@ class VariablesTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD,\r
-            $webUrl . '/index.php');\r
+            "$webUrl/login.php");\r
             \r
         return TRUE;\r
     } \r
@@ -53,10 +53,14 @@ class VariablesTest extends PreconditionSet
     function testVariablesList()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
 \r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=variables'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'variables'))\r
+                                       );\r
         \r
         $this->assertWantedText($lang['strname']);\r
         $this->assertWantedText($lang['strsetting']);\r
index 9556f24d88657944c76483605145e1e7c300bee3..a7477a9b00a7569a0937f0d8fb4c2411656c763b 100644 (file)
@@ -34,15 +34,14 @@ class PreconditionSet extends WebTestCase
      */\r
     function login($userName, $password, $loginPageUrl)\r
     {\r
-       global $lang;\r
-       \r
-        $this->get($loginPageUrl);\r
-        $this->setField('formUsername', $userName);\r
-        $this->setField('formPassword', $password);\r
-        $this->setField('formLanguage', $lang['applang']);\r
-        $this->clickSubmit('Login');\r
-        \r
-        return TRUE;\r
+       global $lang, $SERVER;\r
+\r
+               $this->setCookie("PHPCOVERAGE_HOME", $PHP_SIMPLETEST_HOME);\r
+               $this->get($loginPageUrl, array('server' => $SERVER));\r
+               $this->setField('loginUsername', $userName);\r
+               $this->setFieldById('loginPassword', $password);\r
+               $this->submitFormByid('login_form');\r
+               return TRUE;\r
     }\r
      \r
      \r
@@ -57,13 +56,13 @@ class PreconditionSet extends WebTestCase
     function createDatabase($databaseName, $enCoding) \r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
                \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                            $webUrl . '/index.php');\r
-        $this->get($webUrl . '/all_db.php');   \r
+                            "$webUrl/login.php");\r
+        $this->get("$webUrl/all_db.php", array('server' => $SERVER));  \r
         $this->clickLink('Create database');\r
          \r
         $this->setField('formName', $databaseName);\r
@@ -87,17 +86,22 @@ class PreconditionSet extends WebTestCase
     function dropDatabase($databaseName)\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
                \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         \r
-        $this->get($webUrl . '/all_db.php');  \r
-        $this->get($webUrl . '/all_db.php?action=confirm_drop' .\r
-                      '&subject=database&database=' . $databaseName);\r
-        $this->clickSubmit($lang['strdrop']);  \r
+        $this->get("$webUrl/all_db.php", array('server' => $SERVER));\r
+               $this->get("$webUrl/all_db.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'subject' => 'database',\r
+                       'database' => $databaseName,\r
+                       'dropdatabase' => $databaseName)\r
+               );\r
+               $this->clickSubmit($lang['strdrop']);\r
         \r
         return TRUE;           \r
     }\r
@@ -119,26 +123,30 @@ class PreconditionSet extends WebTestCase
     function createTable($databaseName, $schema, $tableName, $fieldNumber)\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
                \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
                \r
-        $this->get($webUrl . '/tables.php?action=create&database=' .\r
-               $databaseName . '&schema=' .$schema);\r
+               $this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create',\r
+                       'database' => $databaseName,\r
+                       'schema' => $schema)\r
+               );\r
 \r
-        $this->setField('name', $tableName);           \r
+        $this->setField('name', $tableName);\r
         $this->setField('fields', $fieldNumber);\r
         $this->assertTrue($this->setField('spcname', 'pg_default'));\r
         $this->setField('tblcomment', 'Create auto!');\r
-                            \r
-        // Clicks the button "next >" for inputing the detail information.                  \r
+\r
+        // Clicks the button "next >" for inputing the detail information. \r
         //$this->assertTrue($this->ClickSubmit($lang['strnext']));\r
         // If we do not hardcoded it here, it will cause fail. Encoding issue.\r
-        $this->assertTrue($this->ClickSubmit('Next >'));\r
-        \r
+               $this->assertTrue($this->ClickSubmit('Next >'));\r
+\r
         for($ii = 0 ; $ii < $fieldNumber; $ii++) \r
         {\r
             $field = 'field[' . $ii .']';\r
@@ -155,7 +163,7 @@ class PreconditionSet extends WebTestCase
         // Click the button "Create" for creating the\r
         // table use the specify conditions.\r
         $this->clickSubmit($lang['strcreate']); \r
-        \r
+\r
         return TRUE;\r
     }\r
     \r
@@ -173,18 +181,22 @@ class PreconditionSet extends WebTestCase
     {\r
         // Import the global variable.\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
                \r
         // Login and trun to the page which list all the \r
         // table in the database.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
                \r
-        $this->get($webUrl . '/tables.php?action=confirm_drop&database=' . \r
-                   $databaseName . '&schema=' . $schema . '&table=' . \r
-                   $tableName . '&'); \r
+               $this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $databaseName,\r
+                       'schema' => $schema,\r
+                       'table' => $tableName )\r
+               ); \r
                           \r
         // Click the button "Drop" for dropping the table from the database.           \r
         $this->clickSubmit($lang['strdrop']);  \r
@@ -200,7 +212,7 @@ class PreconditionSet extends WebTestCase
     {\r
         global $webUrl;\r
         global $lang;\r
-        $this->get($webUrl . '/index.php');\r
+        $this->get("$webUrl/index.php");\r
         \r
         // Select the frame and logout.\r
         $this->setFrameFocus('topbar');\r
index f58fcef2f2644aaf7ec4325fe7741648f70ccc37..c44070e107d169442bdca2f9f417b6665662d484 100644 (file)
@@ -29,12 +29,11 @@ class AggregateTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
-        \r
-        return TRUE;           \r
-    }\r
-    \r
-    \r
+                     "$webUrl/login.php"); \r
+\r
+        return TRUE;\r
+    }    \r
+\r
     /**\r
      * Clean up all the result. \r
      */\r
@@ -45,8 +44,7 @@ class AggregateTest extends PreconditionSet
         \r
         return TRUE;\r
     }\r
-    \r
-    \r
+\r
     /**\r
      * TestCaseID: HCA01\r
      * Creates a new aggregate.\r
@@ -54,11 +52,15 @@ class AggregateTest extends PreconditionSet
     function testCreateAggregate()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER, $DATABASE;\r
+\r
         // Turn to "sql" page.\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'sql'))\r
+                                       );\r
         // Enter the definition of the new aggregate.\r
         $this->assertTrue($this->setField('query', 'CREATE AGGREGATE ' .\r
                                           'complex_sum(sfunc1 = box_intersect, basetype = box,' .\r
@@ -80,17 +82,20 @@ class AggregateTest extends PreconditionSet
     function testBrowseAggregates()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Aggregates" page.\r
-        $this->assertTrue($this->get($webUrl . '/aggregates.php?database=' .\r
-                                     'test&schema=public&subject=schema'));\r
-                \r
+               $this->assertTrue($this->get("$webUrl/aggregates.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema')\r
+                                       ));\r
+\r
         // Verify whether the aggregates is displayed correctly.\r
         $this->assertTrue($this->assertWantedText('complex_sum'));       \r
-    }\r
-    \r
-    \r
+    }    \r
+\r
     /**\r
      * TestCaseID: HDA01\r
      * Drop a aggregate. \r
@@ -98,15 +103,19 @@ class AggregateTest extends PreconditionSet
     function testDropAggregate()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "sql" page.\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
-        \r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'sql'))\r
+                                       );\r
+\r
         $this->assertTrue($this->setField('query', 'DROP AGGREGATE' .\r
                                           ' complex_sum(box);'));  \r
-        \r
+\r
         // Click the button "Go" to drop the aggregate.\r
         $this->assertTrue($this->clickSubmit($lang['strgo']));\r
         // Verify whether the aggregates is dropped correctly.\r
@@ -115,6 +124,4 @@ class AggregateTest extends PreconditionSet
         return TRUE;\r
     } \r
 }\r
-\r
-\r
 ?>\r
index 442c6c052366d332617bf9849740e6532c7f62cf..dd3fc506674e342978c00afd3fd2c62fd2874f99 100644 (file)
@@ -29,12 +29,11 @@ class ConversionTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
-        \r
+                     "$webUrl/login.php"); \r
+\r
         return TRUE;           \r
     }\r
-    \r
-    \r
+\r
     /**\r
      * Clean up all the result. \r
      */\r
@@ -46,7 +45,6 @@ class ConversionTest extends PreconditionSet
         return TRUE;\r
     }\r
     \r
-    \r
     /**\r
      * TestCaseID: HBC01\r
      * Browse the conversions.\r
@@ -54,19 +52,23 @@ class ConversionTest extends PreconditionSet
     function testBrowseConversion()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER;\r
+\r
         // Turn to schema "pg_catalog" page.\r
-        $this->assertTrue($this->get($webUrl . '/redirect.php?section=schema' .\r
-                                     '&database=template1&schema=pg_catalog&'));\r
+               $this->assertTrue($this->get("$webUrl/redirect.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'section' => 'schema',\r
+                                               'database' => 'template1',\r
+                                               'schema' => 'pg_catalog'))\r
+                                       );\r
         // Click the "Conversions" hyper link.\r
-        $this->assertTrue($this->clickLink($lang['strconversions']));  \r
-        \r
+        $this->assertTrue($this->clickLink($lang['strconversions']));\r
+\r
         // Verify whether the conversions are displayed.\r
         // Normally, there should be conversions in this schema, but if there is no,\r
         // this assert will fail. Need to assert the normal case.\r
         $this->assertTrue($this->assertWantedText($lang['strsourceencoding']));\r
-        \r
+\r
         return TRUE;\r
     } \r
 }    \r
index 5fe99eb82506a571ff880778b1cc8d1c611c6180..4fb1c2e514e75be722ad060cd27de1e03f3fd16d 100644 (file)
@@ -26,15 +26,14 @@ class DomainTest extends PreconditionSet
         global $webUrl;        \r
         global $SUPER_USER_NAME;\r
         global $SUPER_USER_PASSWORD;\r
-        \r
+\r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');  \r
-        \r
+                     "$webUrl/login.php");\r
+\r
         return TRUE;                              \r
-    }\r
-    \r
-    \r
+    }    \r
+\r
     /**\r
      * Cleans up all the result. \r
      */\r
@@ -46,7 +45,6 @@ class DomainTest extends PreconditionSet
         return TRUE;         \r
     }\r
     \r
-    \r
     /**\r
      * TestCaseID: HCD01\r
      * Create a domain.\r
@@ -54,11 +52,15 @@ class DomainTest extends PreconditionSet
     function testCreateDomain()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Create domain" page.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
                 \r
         // Enter the detail information of the new domain.\r
         $this->assertTrue($this->setField('domname', 'spikedomain'));\r
@@ -75,7 +77,6 @@ class DomainTest extends PreconditionSet
         return TRUE;       \r
     } \r
     \r
-    \r
     /**\r
      * TestCaseID: HAD01\r
      * Alter the definition of a domain.\r
@@ -83,24 +84,28 @@ class DomainTest extends PreconditionSet
     function testAlterDomain()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Display the domain which is to be altered.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?action=propert' .\r
-                                     'ies&database=test&schema=public&domain=spikedomain&'));\r
-                \r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'properties',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'domain' => 'spikedomain'))\r
+                                       );\r
+\r
         $this->assertTrue($this->clickLink($lang['stralter']));\r
         $this->assertTrue($this->setField('domowner', 'tester'));    \r
-        \r
+\r
         // Click the "Alter" button to alter the domain.\r
         $this->assertTrue($this->clickSubmit($lang['stralter']));\r
         // Verify whether the domian is altered successfully.\r
         $this->assertTrue($this->assertWantedText($lang['strdomainaltered']));    \r
-        \r
+\r
         return TRUE;   \r
     } \r
-    \r
-    \r
+\r
     /**\r
      * TestCaseID: HAC01\r
      * Add check to an existing domain.\r
@@ -108,29 +113,33 @@ class DomainTest extends PreconditionSet
     function testAddCheck()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER, $DATABASE;\r
+\r
         // Display the domain to be be altered.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?action=properties&' .\r
-                                     'database=test&schema=public&domain=spikedomain&'));\r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'properties',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'domain' => 'spikedomain'))\r
+                                       );\r
 \r
         $this->assertTrue($this->clickLink($lang['straddcheck']));\r
-        \r
+\r
         // Enter the check's definition.\r
         $this->assertTrue($this->setField('name', 'newcheck'));\r
         $this->assertTrue($this->setField('definition',\r
                                           'VALUE[0] > 3'));\r
-        \r
+\r
         // Click the "Add" button add a new check.\r
         $this->assertTrue($this->clickSubmit($lang['stradd']));\r
-        \r
+\r
         // Verify whether the new check added.\r
         $this->assertTrue($this->assertWantedText($lang['strcheckadded']));    \r
-        \r
+\r
         return TRUE;   \r
-    }\r
-    \r
-    \r
+    }    \r
+\r
     /**\r
      * TestCaseID: HDC01\r
      * Drops an existing constraint of a domain.\r
@@ -138,31 +147,39 @@ class DomainTest extends PreconditionSet
     function testDropConstraint()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER, $DATABASE;\r
+\r
         // Turn to the domains-display page.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?database=test&' .\r
-                                     'schema=public&'));\r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public&'))\r
+                                       );\r
 \r
         // Display the specfied damain.\r
         $this->assertTrue($this->clickLink('spikedomain'));\r
-        \r
+\r
         // Drop the constraint.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?action=confirm_drop_con&' .\r
-                                     'database=test&schema=public&constraint=newcheck&' .\r
-                                     'domain=spikedomain&type=c'));\r
-                \r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop_con',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'constraint' => 'newcheck',\r
+                                               'domain' => 'spikedomain',\r
+                                               'type' => 'c'))\r
+                                       );\r
+\r
         $this->assertTrue($this->setField('cascade', TRUE));\r
-        \r
+\r
         // Click the "Drop" button to drop the constraint.\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify whether the constraint is dropped successfully.        \r
         $this->assertTrue($this->assertWantedText($lang['strconstraintdropped']));\r
-        \r
+\r
         return TRUE;           \r
     }\r
-    \r
-         \r
+\r
     /**\r
      * TestCaseID: HDD01\r
      * Drop an existing domain.\r
@@ -170,14 +187,23 @@ class DomainTest extends PreconditionSet
     function testDropDomain()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER, $DATABASE;\r
+\r
         // Turn to the "domains" page.\r
-        $this->assertTrue($this->get($webUrl . '/domains.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
-                \r
-        $this->assertTrue($this->get($webUrl . '/domains.php?action=confirm_drop&' .\r
-                                     'database=test&schema=public&domain=spikedomain&'));\r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
+\r
+               $this->assertTrue($this->get("$webUrl/domains.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'domain' => 'spikedomain'))\r
+                                       );\r
         $this->assertTrue($this->setField('cascade', TRUE));    \r
         \r
         // Click the "Drop" button to drop the domain.\r
index 8c86c86d4bc4d9147ebe2392650cc5521ad68171..2cdc970c03de798aa5eff1e1b050c0916ea88210 100644 (file)
@@ -29,8 +29,8 @@ class FunctionTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
-        \r
+                     "$webUrl/login.php"); \r
+\r
         return TRUE;\r
     }\r
     \r
@@ -54,11 +54,15 @@ class FunctionTest extends PreconditionSet
     function testCreatSqlFunction()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $DATABASE, $SERVER;\r
+\r
         // Turn to the "Create SQL/PL function" page.\r
-        $this->assertTrue($this->get($webUrl . '/functions.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/functions.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
           \r
         // Enter the detail information of a SQL/PL function.\r
         $this->assertTrue($this->setField('formFunction', 'sqlplfunction')); \r
@@ -81,7 +85,6 @@ class FunctionTest extends PreconditionSet
         return TRUE;          \r
     } \r
     \r
-    \r
     /**\r
      * TestCaseID: HCF02\r
      * Create a internal function.\r
@@ -89,11 +92,16 @@ class FunctionTest extends PreconditionSet
     function testCreateInternalFunction()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Create internal function" page.\r
-        $this->assertTrue($this->get($webUrl . '/functions.php?action=create&' .\r
-                                     'language=internal&database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/functions.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'language' => 'internal',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
                 \r
         // Enter the detail information of a SQL/PL function.\r
         $this->assertTrue($this->setField('formFunction', 'internalfunction'));    \r
@@ -114,8 +122,7 @@ class FunctionTest extends PreconditionSet
 \r
         return TRUE;   \r
     }\r
-    \r
-    \r
+\r
     /**\r
      * TestCaseID: HCF03\r
      * Create a C function. \r
@@ -123,10 +130,13 @@ class FunctionTest extends PreconditionSet
     function testCreateCFunction()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
-        $this->assertTrue($this->get($webUrl . '/functions.php?database=test' .\r
-                                     '&schema=public&'));\r
+        global $lang, $SERVER, $DATABASE;\r
+\r
+               $this->assertTrue($this->get("$webUrl/functions.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
         // Turn to the C-function create page.\r
         $this->assertTrue($this->clickLink($lang['strcreatecfunction']));  \r
         \r
@@ -157,11 +167,15 @@ class FunctionTest extends PreconditionSet
     function testAlterFunction()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the function-display page.\r
-        $this->assertTrue($this->get($webUrl . '/functions.php?database=test' .\r
-                                     '&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/functions.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         \r
         // Alter the definiton of "cfunction".        \r
         $this->assertTrue($this->clickLink('cfunction (text)'));\r
@@ -188,11 +202,15 @@ class FunctionTest extends PreconditionSet
     function testDropFunction()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the function-display page.\r
-        $this->assertTrue($this->get($webUrl . '/functions.php?database=test' .\r
-                                     '&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/functions.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
        \r
         // Drop the fucntion "sqlplfunction". \r
         $this->assertTrue($this->clickLink('sqlplfunction (double precision[], double precision)'));        \r
index 09626667801957559febd383cd0636d8fecb8bee..f6b2a32863155ec5e49ec3d13c90fe87affe49d5 100644 (file)
@@ -30,7 +30,7 @@ class OpClassTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');  \r
+                     "$webUrl/login.php");  \r
         \r
         return TRUE;          \r
     }\r
@@ -55,11 +55,15 @@ class OpClassTest extends PreconditionSet
     function testBrowseOpClass()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to schema "pg_catalog" page.\r
-        $this->assertTrue($this->get($webUrl . '/opclasses.php?database=' .\r
-                                     'test&schema=pg_catalog&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/opclasses.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'pg_catalog',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         \r
         // Verify whether all the op classes are displayed.\r
         $this->assertTrue($this->assertWantedText($lang['straccessmethod']));\r
index 9a678a8437c41b11f8b46b8dc95c3a8a4876e25a..0174349171b55f19ea6d4661d302be6825cbf6f8 100644 (file)
@@ -29,8 +29,8 @@ class OperatorTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
-        \r
+                     "$webUrl/login.php"); \r
+\r
         return TRUE;           \r
     }\r
     \r
@@ -54,11 +54,15 @@ class OperatorTest extends PreconditionSet
     function testCreateOperator()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "sql" page.\r
-        $this->assertTrue($this->get($webUrl . '/database.php?database=test' .\r
-                                     '&subject=database&action=sql'));\r
+               $this->assertTrue($this->get("$webUrl/database.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'subject' => 'database',\r
+                                               'action' => 'sql'))\r
+                                       );\r
         // Enter the definition of the new operator.\r
         $this->assertTrue($this->setField('query', 'CREATE OPERATOR === (' .\r
                                           'LEFTARG = box, RIGHTARG = box, PROCEDURE = box_above, ' .\r
@@ -81,11 +85,15 @@ class OperatorTest extends PreconditionSet
     function testShowProperty()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Operators" page.\r
-        $this->assertTrue($this->get($webUrl . '/operators.php?' .\r
-                                     'database=test&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/operators.php", array(\r
+                              'server' => $SERVER,\r
+                                          'database' => $DATABASE,\r
+                                          'schema' => 'public',\r
+                                          'subject' => 'schema'))\r
+                                  );\r
         // Show the properties of the operator "===".\r
         $this->assertTrue($this->clickLink('==='));\r
         // Check the properties.\r
@@ -102,11 +110,15 @@ class OperatorTest extends PreconditionSet
     function testDropOperator()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Operators" page.\r
-        $this->assertTrue($this->get($webUrl . '/operators.php?' .\r
-                                     'database=test&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/operators.php", array(\r
+                              'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
                 \r
         // Drop the first operator.        \r
         $this->assertTrue($this->clickLink($lang['strdrop']));\r
index b00bb298a2100f0506c0b6546608abfca67c7ace..648870d3ebc5c61f12becf5c0678101d7a63ca08 100644 (file)
@@ -29,24 +29,15 @@ class SchemasGroupTest extends GroupTest
        $this->GroupTest('Schema management group test.');\r
 \r
         $this->addTestClass(new TableTest());\r
-        \r
-        $this->addTestClass(new ViewTest()); \r
-        \r
+        $this->addTestClass(new ViewTest());\r
         $this->addTestClass(new SequenceTest());\r
-\r
-        $this->addTestClass(new FunctionTest()); \r
-        \r
+        $this->addTestClass(new FunctionTest());\r
         $this->addTestClass(new TypeTest());\r
-        \r
         $this->addTestClass(new DomainTest());\r
-\r
         $this->addTestClass(new AggregateTest());\r
-        \r
         $this->addTestClass(new OperatorTest());\r
-        \r
         $this->addTestClass(new OpClassTest());\r
-        \r
-        $this->addTestClass(new ConversionTest());  \r
+               $this->addTestClass(new ConversionTest());\r
     }\r
 }\r
 ?>\r
index d8831ced3fbfbe007957abf79551c947bb9cc203..19cbcc3662ab8c6b1a59d0a89331c5a5fc9f3218 100644 (file)
@@ -30,7 +30,7 @@ class SequenceTest extends PreconditionSet
     \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;          \r
     }\r
@@ -55,11 +55,15 @@ class SequenceTest extends PreconditionSet
     function testCreateSequence()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Create sequence" page.\r
-        $this->assertTrue($this->get($webUrl . '/sequences.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/sequences.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
                 \r
         // Enter the detail information of a sequence.\r
         $this->assertTrue($this->setField('formSequenceName', 'createsequence'));    \r
@@ -87,11 +91,15 @@ class SequenceTest extends PreconditionSet
     function testResetSequence()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the sequence-display page.\r
-        $this->assertTrue($this->get($webUrl . '/sequences.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/sequences.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         // Browse the specified sequence.\r
         $this->assertTrue($this->clickLink('createsequence')); \r
         // Reset the sequence.\r
@@ -113,14 +121,19 @@ class SequenceTest extends PreconditionSet
     function testDropSequence()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/sequences.php?action=confirm_drop&' .\r
-                                     'database=test&schema=public&sequence=createsequence&'));\r
+               $this->assertTrue($this->get("$webUrl/sequences.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'sequence' => 'createsequence'))\r
+                                       );\r
 \r
         $this->assertTrue($this->setField('cascade', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
-        \r
+\r
         // Verify if the sequence dropped successful.\r
         $this->assertTrue($this->assertWantedText($lang['strsequencedropped']));\r
         \r
index 9f63850342516a708832b8b35c272b9c88ebf386..7671779ac0869486349067c6d978b5ae97c5a640 100644 (file)
@@ -28,7 +28,7 @@ class TableTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;\r
         \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;\r
     }\r
@@ -53,11 +53,15 @@ class TableTest extends PreconditionSet
     function testCreateTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the create table page to create a table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public'))\r
+               );\r
         \r
         // Enter the table name and field number.\r
         $this->assertTrue($this->setField('name', 'newtable'));        \r
@@ -86,7 +90,7 @@ class TableTest extends PreconditionSet
         $this->assertTrue($this->assertWantedText($lang['strtablecreated']));\r
         \r
         // Drop the table which is created in the testcase.\r
-        $this->dropTable('test', 'newtable', 'public');\r
+        $this->dropTable($DATABASE, 'newtable', 'public');\r
         \r
         return TRUE;   \r
     }\r
@@ -99,11 +103,15 @@ class TableTest extends PreconditionSet
     function testCreateTableWithBadFieldNumber()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the create table page to create a table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public'))\r
+               );\r
         \r
         // Enter no name.\r
         //$this->assertTrue($this->clickSubmit($lang['strnext']));\r
@@ -143,11 +151,15 @@ class TableTest extends PreconditionSet
     function testCreateTableWithBadFieldData()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the create table page to create a table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public'))\r
+               );\r
         \r
         // Enter the table name and field number.        \r
         $this->assertTrue($this->setField('name', 'badfield'));        \r
@@ -188,14 +200,19 @@ class TableTest extends PreconditionSet
     function testInsertOneRow()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER,$DATABASE;\r
           \r
         // Create a table.     \r
-        $this->createTable('test', 'public', 'viewtest', '3');\r
+        $this->createTable($DATABASE, 'public', 'viewtest', '3');\r
           \r
         // Turn to the "Insert row" interface.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confinsertrow&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confinsertrow',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'viewtest'))\r
+               );\r
           \r
         // Set the value of the fields.               \r
         $this->assertTrue($this->setField('values[field0]', 'row1column1'));\r
@@ -218,11 +235,16 @@ class TableTest extends PreconditionSet
     function testInsertTwoRows()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Insert row" interface.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confinsertrow&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confinsertrow',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
           \r
         // Set the value of the fields.        \r
         $this->assertTrue($this->setField('values[field0]', 'row2column1'));\r
@@ -257,12 +279,17 @@ class TableTest extends PreconditionSet
     function testInsertWithBadData()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Insert row" interface.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confinsertrow&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
-          \r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confinsertrow',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
+\r
         // Set the value of the fields.\r
         $this->assertTrue($this->setField('format[field0]', 'Expression'));\r
         $this->assertTrue($this->setField('format[field1]', 'Expression'));\r
@@ -283,22 +310,28 @@ class TableTest extends PreconditionSet
 \r
     /**\r
      * TestCaseID: HER01\r
-     * Edit a row.\r
+        * Edit a row.\r
+        * XXX Fail cause we have no index on viewtest, created by $this->createable\r
+        * see Public/SetPrecondition.php\r
      */\r
     function testEditRow()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Tables" interface.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?database=test&schema=public&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
         // Select the table "viewtest".\r
-        $this->assertTrue($this->clickLink('viewtest'));\r
+               $this->assertTrue($this->clickLink('viewtest'));\r
         // Browse the table.\r
-        $this->assertTrue($this->clickLink($lang['strbrowse']));\r
+               $this->assertTrue($this->clickLink($lang['strbrowse']));\r
         // Select a row.\r
-        $this->assertTrue($this->clickLink($lang['stredit']));\r
-                  \r
+               $this->assertTrue($this->clickLink($lang['stredit']));\r
+\r
         // Edit the row.\r
         $this->assertTrue($this->setField('values[field0]', 'updatecolumn0'));\r
         $this->assertTrue($this->setField('values[field1]', 'updatecolumn1'));\r
@@ -308,22 +341,27 @@ class TableTest extends PreconditionSet
         $this->assertTrue($this->clickSubmit($lang['strsave']));\r
         // Verify whether the edit is done successfully.\r
         $this->assertTrue($this->assertWantedText('updatecolumn0'));\r
-        \r
+\r
         return TRUE;\r
     } \r
     \r
     \r
     /**\r
      * TestCaseID: HDR01\r
-     * Delete a row.\r
+        * Delete a row.\r
+        * XXX Fail, see comment on testEditRow\r
      */\r
     function testDeleteRow()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Tables" interface.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?database=test&schema=public&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
         // Select the table "viewtest".\r
         $this->assertTrue($this->clickLink('viewtest'));\r
         // Browse the table.\r
@@ -345,13 +383,18 @@ class TableTest extends PreconditionSet
     function testBrowseTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Browse table" interface.\r
-        $this->assertTrue($this->get($webUrl . '/display.php?database=test&' .\r
-                                     'schema=public&subject=table&return_url=tables.php%3Fdatab' .\r
-                                     'ase%3Dtest%26amp%3Bschema%3Dpublic&return_desc=Back&table=' .\r
-                                     'viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/display.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'table',\r
+                                               'return_url' => 'tables.php%3Fdatabase%3Dtest%26amp%3Bschema%3Dpublic',\r
+                                               'return_desc' => 'Back',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
                                      \r
         // Verify whether the rows are displayed.         \r
         $this->assertTrue($this->assertWantedText($lang['strrows'])); \r
@@ -375,11 +418,15 @@ class TableTest extends PreconditionSet
     function testSelectAll()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "tables" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?database=test' .\r
-                                     '&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         $this->assertTrue($this->clickLink('viewtest'));\r
         \r
         // Select all the rows.\r
@@ -396,7 +443,6 @@ class TableTest extends PreconditionSet
         return TRUE;\r
     }\r
     \r
-    \r
     /**\r
      * TestCaseID: HST02\r
      * Select rows according to the query conditions.\r
@@ -404,11 +450,17 @@ class TableTest extends PreconditionSet
     function testSelectByConditions()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "tables" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confselectrows&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confselectrows',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
+\r
         // Display all columns.\r
         $this->assertTrue($this->setField('show[field0]', TRUE));\r
         $this->assertTrue($this->setField('show[field1]', TRUE));\r
@@ -425,7 +477,6 @@ class TableTest extends PreconditionSet
         return TRUE;\r
     } \r
      \r
-     \r
     /**\r
      * TestCaseID: HST03\r
      * Select data from an existing table with no row display.\r
@@ -433,11 +484,16 @@ class TableTest extends PreconditionSet
     function testSelectTableNoRowDisplay()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "tables" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confselectrows&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confselectrows',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
 \r
         // Enter the query conditions.\r
         $this->assertTrue($this->setField('values[field0]', 'row2column1'));\r
@@ -460,11 +516,16 @@ class TableTest extends PreconditionSet
     function testVacuumUnchecked()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Vacuum" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_vacuum&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_vacuum',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
                 \r
         // Click the "Vacuum" button.        \r
         $this->assertTrue($this->clickSubmit($lang['strvacuum'])); \r
@@ -482,11 +543,16 @@ class TableTest extends PreconditionSet
     function testVacuumChecked()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Vacuum" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_vacuum&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_vacuum',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
         \r
         // Make sure the check box "Full" and "Analyze" are checked     \r
         $this->assertTrue($this->setField('vacuum_full', TRUE));\r
@@ -508,15 +574,24 @@ class TableTest extends PreconditionSet
     function testEmptyTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "tables" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
                 \r
         // Empty a table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_empty&' .\r
-                                     'database=test&schema=public&table=viewtest&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_empty',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
         // Click the "Empty" button to clean the content of the table.\r
         $this->assertTrue($this->clickSubmit($lang['strempty']));\r
         \r
@@ -534,14 +609,23 @@ class TableTest extends PreconditionSet
     function testAlterTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?database=test' .\r
-                                     '&schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         // Select the table.\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?action=confirm_alter&' .\r
-                                     'database=test&schema=public&table=viewtest'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_alter',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'viewtest'))\r
+                                       );\r
                 \r
         $this->assertTrue($this->setField('name', 'testview'));\r
         $this->assertTrue($this->setField('owner', 'tester'));\r
@@ -561,11 +645,17 @@ class TableTest extends PreconditionSet
     function testDropTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=confirm_drop&' .\r
-                                     'database=test&schema=public&table=testview&'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'testview'))\r
+               );\r
+\r
         $this->assertTrue($this->setField('cascade', TRUE));        \r
         // Click the "Drop" button to drop the table.\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
index 27ba3b5fdcec2ba199dc8ec2512c703f9bf520b0..acd683667d23fcf13b7a2cdbec2f3c3fb0269857 100644 (file)
@@ -29,7 +29,7 @@ class TypeTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;           \r
     }\r
@@ -54,11 +54,15 @@ class TypeTest extends PreconditionSet
     function testCreateType()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Types" page.\r
-        $this->assertTrue($this->get($webUrl . '/types.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/types.php", array(\r
+                       'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'subject' => 'schema'))\r
+               );\r
         $this->assertTrue($this->clickLink($lang['strcreatetype']));\r
         \r
         // Enter the definition of the type.\r
@@ -81,11 +85,15 @@ class TypeTest extends PreconditionSet
     function testCreateCompositeType()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Types" page.\r
-        $this->assertTrue($this->get($webUrl . '/types.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/types.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         $this->assertTrue($this->clickLink($lang['strcreatecomptype']));\r
 \r
         // Create without composite type name.\r
@@ -135,11 +143,15 @@ class TypeTest extends PreconditionSet
     function testShowProperty()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to "Types" page.\r
-        $this->assertTrue($this->get($webUrl . '/types.php?database=test&' .\r
-                                     'schema=pg_catalog&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/types.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'pg_catalog',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
                 \r
         // Show the properties of general type.\r
         $this->assertTrue($this->clickLink('integer'));\r
@@ -148,8 +160,12 @@ class TypeTest extends PreconditionSet
         \r
         \r
         // Turn to "Types" page.\r
-        $this->assertTrue($this->get($webUrl . '/types.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/types.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
                 \r
         // Show the properties of a composite type "compositetype".\r
         $this->assertTrue($this->clickLink('compositetype'));\r
@@ -167,11 +183,16 @@ class TypeTest extends PreconditionSet
     function testDropType()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to type-dropped confirm page.\r
-        $this->assertTrue($this->get($webUrl . '/types.php?action=confirm_drop&' .\r
-                                     'database=test&schema=public&type=compositetype&'));\r
+               $this->assertTrue($this->get("$webUrl/types.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'type' => 'compositetype'))\r
+                                       );\r
                 \r
         $this->assertTrue($this->setField('cascade', TRUE));        \r
                 \r
index 99f48f43c37ccec95722c9495a0fc37d9a693316..db1bf0176c73b645c8c0bc63bd51ca6fef88b031 100644 (file)
@@ -29,7 +29,7 @@ class ViewTest extends PreconditionSet
         \r
         // Login the system.\r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;\r
     }\r
@@ -55,13 +55,17 @@ class ViewTest extends PreconditionSet
     {\r
        \r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->createTable('test', 'public', 'viewtest', '3');       \r
-         \r
+        $this->createTable($DATABASE, 'public', 'viewtest', '3');       \r
+\r
         // Turn to the "Create view" page.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
 \r
         // Enter the definition of the view.        \r
         $this->assertTrue($this->setField('formView', 'createviewdirectly'));        \r
@@ -86,12 +90,16 @@ class ViewTest extends PreconditionSet
     function testCreateViewWithWizard()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
         // Turn to the "Create view with wizard" page.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=wiz_create&' .\r
-                                     'database=test&schema=public'));\r
-                 \r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'wiz_create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
+\r
         // Select the table.        \r
         $this->assertTrue($this->setField('formTables[]',  array('public.viewtest')));    \r
        \r
@@ -118,11 +126,15 @@ class ViewTest extends PreconditionSet
     function testCreateViewDirectlyNegative()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Turn to the "Create view" page.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
          \r
         // Enter the definition of the view.        \r
         $this->assertTrue($this->setField('formView', 'createviewdirectly'));        \r
@@ -149,11 +161,15 @@ class ViewTest extends PreconditionSet
     function  testCreateViewWithWizardNegation()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
         // Turn to the "Create view with wizard" page.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=wiz_create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'wiz_create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public'))\r
+                                       );\r
                  \r
         // Select the table.        \r
         $this->assertTrue($this->setField('formTables[]', array('public.viewtest')));\r
@@ -180,13 +196,18 @@ class ViewTest extends PreconditionSet
     function testBrowseView()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
         // Browse the view "createviewdirectly" created just now.\r
-        $this->assertTrue($this->get($webUrl . '/display.php?database=test&' .\r
-                                     'schema=public&subject=view&return_url=views.php%3Fdatabase%' .\r
-                                     '3Dtest%26amp%3Bschema%3Dpublic&return_desc=Back&view=' .\r
-                                     'createviewdirectly&')); \r
+               $this->assertTrue($this->get("$webUrl/display.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'view',\r
+                                               'return_url' => 'views.php%3Fdatabase%3Dtest%26amp%3Bschema%3Dpublic',\r
+                                               'return_desc' => 'Back',\r
+                                               'view' => 'createviewdirectly'))\r
+                                       ); \r
                   \r
         // Click the links in the view-display page.\r
         $this->assertTrue($this->clickLink($lang['strexpand']));\r
@@ -205,10 +226,15 @@ class ViewTest extends PreconditionSet
     function testSelectView()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=confselectrows&' .\r
-                                     'database=test&schema=public&view=createviewdirectly&')); \r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confselectrows',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'view' => 'createviewdirectly'))\r
+                                       ); \r
      \r
         // Enter the query conditions.\r
         $this->assertTrue($this->setField('show[field0]', TRUE)); \r
@@ -230,11 +256,15 @@ class ViewTest extends PreconditionSet
     function testAlterView()\r
      {\r
          global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
          // Turn to the view display page.\r
-         $this->assertTrue($this->get($webUrl . '/views.php?database=test&' .\r
-                                      'schema=public&subject=schema'));\r
+                $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                    'server' => $SERVER,\r
+                                                'database' => $DATABASE,\r
+                                                'schema' => 'public',\r
+                                                'subject' => 'schema'))\r
+                                        );\r
          // Select a view.\r
          $this->assertTrue($this->clickLink('createviewdirectly'));\r
          // Select a column.\r
@@ -259,15 +289,19 @@ class ViewTest extends PreconditionSet
     function testAlterDefinition()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
         // Turn to the view display page.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?database=test&' .\r
-                                     'schema=public&subject=schema'));\r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'subject' => 'schema'))\r
+                                       );\r
         // Select a view.\r
         $this->assertTrue($this->clickLink('createviewdirectly'));\r
         // Browse the definition of the view.\r
-        $this->assertTrue($this->clickLink($lang['strdefinition'])); \r
+        $this->assertTrue($this->clickLink("{$lang['strdefinition']} {$lang['strdefinition']}"));\r
         $this->assertTrue($this->clickLink($lang['stralter']));\r
         \r
         // Alter the definition here.\r
@@ -280,7 +314,7 @@ class ViewTest extends PreconditionSet
         $this->assertTrue($this->clickSubmit($lang['stralter']));\r
         //Verify whether the definition is altered.\r
         $this->assertTrue($this->assertWantedText($lang['strviewupdated'])); \r
-                \r
+\r
         return TRUE;\r
     }\r
      \r
@@ -292,11 +326,16 @@ class ViewTest extends PreconditionSet
     function testDropView()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
          \r
         // Drop the view which was created in the last case.\r
-        $this->assertTrue($this->get($webUrl . '/views.php?action=confirm_drop&' .\r
-                'database=test&schema=public&view=createviewdirectly&'));\r
+               $this->assertTrue($this->get("$webUrl/views.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'view' => 'createviewdirectly'))\r
+                                       );\r
                 \r
         $this->assertTrue($this->setField('cascade', TRUE));         \r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
@@ -305,7 +344,7 @@ class ViewTest extends PreconditionSet
         $this->assertTrue($this->assertWantedText($lang['strviewdropped']));\r
         \r
         // Drop the table which is created in setUp().\r
-        $this->dropTable('test', 'viewtest', 'public');\r
+        $this->dropTable($DATABASE, 'viewtest', 'public');\r
         \r
         return TRUE;   \r
     } \r
index 2f9328a9aaaeba1940b44059892e94b659acb06e..e03a897cde2aab3c82064fa54006c3474ca38139 100644 (file)
@@ -28,20 +28,18 @@ class GroupsTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $SUPER_USER_PASSWORD;
         
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
         
         return TRUE;
     }
-    
-    
+
     function tearDown()
     {
         $this->logout();
-        
+
         return TRUE;
     }
-   
-   
+
     /*
      * TestCaseID: SCG01
      * Test to create group. 
@@ -51,16 +49,16 @@ class GroupsTest extends PreconditionSet
         global $webUrl;
         global $POWER_USER_NAME;
         global $NORMAL_USER_NAME;
-        global $lang;
-        
+        global $lang, $SERVER;
+
         // Turn to create group page.
-        $this->assertTrue($this->get($webUrl . '/groups.php'));
+               $this->assertTrue($this->get("$webUrl/groups.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($lang['strcreategroup']));
-       
+
         // Enter the information for creating group.
         $this->assertTrue($this->setField('name', $this->_groupName));
         $this->assertTrue($this->setField('members[]', array($POWER_USER_NAME, $NORMAL_USER_NAME)));
-       
+
         // Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['strcreate']));
         $this->assertWantedText($lang['strgroupcreated']);
@@ -68,8 +66,8 @@ class GroupsTest extends PreconditionSet
 
         return TRUE;
     }
-    
-    
+
+
     /*
      * TestCaseID: SAG01
      * Test to add users to the gruop.
@@ -80,12 +78,15 @@ class GroupsTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $POWER_USER_NAME;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the gruop's properties page.
-        $this->assertTrue($this->get($webUrl . '/groups.php'));
-        $this->assertTrue($this->get($webUrl . '/groups.php?action=properties' . 
-                                     '&group=' . $this->_groupName));
+        $this->assertTrue($this->get("$webUrl/groups.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/groups.php",
+                       array('action' => 'properties',
+                               'group' => $this->_groupName,
+                               'server' => $SERVER))
+               );
        
         // Select user and add it to the group.
         $this->assertTrue($this->setField('user', $SUPER_USER_NAME));
@@ -112,12 +113,15 @@ class GroupsTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $POWER_USER_NAME;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the gruop properties page.
-        $this->assertTrue($this->get($webUrl . '/groups.php'));
-        $this->assertTrue($this->get($webUrl . '/groups.php?action=properties' . 
-                          '&group=' . $this->_groupName));
+        $this->assertTrue($this->get("$webUrl/groups.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/groups.php",
+                       array('action' => 'properties',
+                               'group' => $this->_groupName,
+                               'server' => $SERVER))
+               );
        
         // Drop users from the group and verify it.
         $this->assertTrue($this->clickLink($lang['strdrop']));
@@ -135,12 +139,15 @@ class GroupsTest extends PreconditionSet
     function testDrop() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the drop group page..
-        $this->assertTrue($this->get($webUrl . '/groups.php'));
-        $this->assertTrue($this->get($webUrl . '/groups.php?action=confirm_drop' . 
-                                     '&&group=' . $this->_groupName));
+        $this->assertTrue($this->get("$webUrl/groups.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/groups.php",
+                       array('server' => $SERVER,
+                               'action' => 'confirm_drop',
+                               'group' => $this->_groupName))
+               );
        
         // Confirm to drop the group and verify it.
         $this->assertTrue($this->clickSubmit($lang['strdrop']));
index aa821e1e9c3d49b772ccce6e5dd1088c05563525..e1dca6e222782c890ae8dcf3de85353c077c78be 100644 (file)
@@ -28,7 +28,7 @@ class ReportsTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $SUPER_USER_PASSWORD;
         
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
         
         return TRUE;
     }
@@ -49,27 +49,27 @@ class ReportsTest extends PreconditionSet
     function testCreate() 
     {
         global $webUrl;
-        global $lang;
-        
+        global $lang, $SERVER, $DATABASE;
+
         // Turn to the create report page.
-        $this->assertTrue($this->get($webUrl . '/reports.php'));
+               $this->assertTrue($this->get("$webUrl/reports.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($lang['strcreatereport']));
-       
+
         // Enter information for creating a report.
         $this->assertTrue($this->setField('report_name', $this->_reportName));
-        $this->assertTrue($this->setField('db_name', 'test'));
+        $this->assertTrue($this->setField('db_name', $DATABASE));
         $this->assertTrue($this->setField('descr', 'comment'));
         $this->assertTrue($this->setField('report_sql', 'select * from student where 1=0'));
-       
+
         //Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['strsave']));
         $this->assertWantedText($lang['strreportcreated']);
         $this->assertWantedText($this->_reportName);
-        
+
         return TRUE;
     }
-    
-    
+
+
     /*
      * TestCaseID: SRR01
      * Test to run existing report.
@@ -77,27 +77,32 @@ class ReportsTest extends PreconditionSet
     function testRun() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
 
         // Run the existing report and verify it.
-        $this->assertTrue($this->get($webUrl . '/reports.php'));
-        $this->assertTrue($this->clickLink($lang['strexecute']));
+               $this->assertTrue($this->get("$webUrl/reports.php", array('server' => $SERVER)));
+               $this->assertTrue($this->clickLink($lang['strexecute']));
         $this->assertWantedText($lang['strnodata']);
-        
-        $this->assertTrue($this->clickLink($lang['strrefresh']));
+
+/* XXX there's no refresh link on report results page. see sql.php
+               $this->assertTrue($this->clickLink($lang['strrefresh']));
         $this->assertWantedText($lang['strnodata']);
-        
+ */
+/* XXX there's no expand-collapse link on report results page. see sql.php
         $this->assertTrue($this->clickLink($lang['strexpand']));
         $this->assertWantedText($lang['strnodata']);
         $this->assertWantedText($lang['strcollapse']);
-        
+
         $this->assertTrue($this->clickLink($lang['strcollapse']));
         $this->assertWantedText($lang['strnodata']);
-        $this->assertWantedText($lang['strexpand']);
-        
+               $this->assertWantedText($lang['strexpand']);
+*/
+
+/* XXX btw, there's a "create report" link in the report results page o_O */
+
         return TRUE;
     }
-        
+
 
     /*
      * TestCaseID: SER01
@@ -106,16 +111,16 @@ class ReportsTest extends PreconditionSet
     function testEdit() 
     {
         global $webUrl;
-        global $lang;
-        
+        global $lang, $SERVER, $DATABASE;
+
         // Turn to the edit report page.
-        $this->assertTrue($this->get($webUrl . '/reports.php'));
+        $this->assertTrue($this->get("$webUrl/reports.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($this->_reportName));
         $this->assertTrue($this->clickLink($lang['stredit']));
-       
+
         // Enter the information for altering the report's properties.
         $this->assertTrue($this->setField('report_name', $this->_reportName));
-        $this->assertTrue($this->setField('db_name', 'test'));
+        $this->assertTrue($this->setField('db_name', $DATABASE));
         $this->assertTrue($this->setField('descr', 'comment is changed'));
         $this->assertTrue($this->setField('report_sql', 'select * from student where 0=1'));
 
@@ -135,10 +140,10 @@ class ReportsTest extends PreconditionSet
     function testDrop() 
     {
         global $webUrl;
-        global $lang;
-        
+        global $lang, $SERVER;
+
         // Turn to the drop report page.
-        $this->assertTrue($this->get($webUrl . '/reports.php'));
+        $this->assertTrue($this->get("$webUrl/reports.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($lang['strdrop']));
        
         // Confirm to drop the report and verify it.        
index d8da4469ba043362c6417a6f81662f1d1002b378..c22a3feaeee77f2e47df1664b9043c65662b9057 100644 (file)
@@ -31,7 +31,7 @@ class TableSpacesTest extends PreconditionSet
         global $SUPER_USER_PASSWORD;
         global $lang;
         
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
 
         return TRUE;
     }
@@ -46,17 +46,18 @@ class TableSpacesTest extends PreconditionSet
    
     /*
      * TestCaseID: SCT01
-     * Test to create tablespace.
+        * Test to create tablespace.
+        * XXX: Your PgSQL admin user must own data/TableSpace
      */
     function testCreate() 
     {
         global $webUrl;
         global $POWER_USER_NAME;
-        global $lang;
-        $this->_location = getcwd() . '/../data/TableSpace';
+        global $lang, $SERVER;
+        $this->_location = getcwd() . '/data/TableSpace';
 
         // Turn to the create tablespace page.
-        $this->assertTrue($this->get($webUrl . '/tablespaces.php'));
+        $this->assertTrue($this->get("$webUrl/tablespaces.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($lang['strcreatetablespace']));
        
         // Enter information for creating a tablespace.
@@ -65,8 +66,8 @@ class TableSpacesTest extends PreconditionSet
         $this->assertTrue($this->setField('formLoc', $this->_location));
        
         // Then submit and verify it.
-        $this->assertTrue($this->clickSubmit($lang['strcreate']));
-        $this->assertWantedText($this->_tableSpaceName);
+               $this->assertTrue($this->clickSubmit($lang['strcreate']));
+               $this->assertWantedText($lang['strtablespacecreated']);
         
         return TRUE;
     }
@@ -80,21 +81,24 @@ class TableSpacesTest extends PreconditionSet
     {
         global $webUrl;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the alter tablespace page.
-        $this->assertTrue($this->get($webUrl . '/tablespaces.php'));
-        $this->assertTrue($this->get($webUrl . '/tablespaces.php?action=edit' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
-       
+               $this->assertTrue($this->get("$webUrl/tablespaces.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/tablespaces.php", array(
+                                   'server' => $SERVER,
+                                               'action' => 'edit',
+                                               'tablespace' => $this->_tableSpaceName))
+                                       );
+
         // Enter information for altering the tableSpace's properties.
         $this->assertTrue($this->setField('name', $this->_tableSpaceName));
         $this->assertTrue($this->setField('owner', $NORMAL_USER_NAME));
-       
+
         // Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['stralter']));
         $this->assertWantedText($lang['strtablespacealtered']);
-        
+
         return TRUE;
     }
     
@@ -106,12 +110,15 @@ class TableSpacesTest extends PreconditionSet
     {
         global $webUrl;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the privileges page.
-        $this->assertTrue($this->get($webUrl . '/privileges.php'));
-        $this->assertTrue($this->get($webUrl . '/privileges.php?subject=tablespace' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
+        $this->assertTrue($this->get("$webUrl/privileges.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/privileges.php", array(
+                                   'server' => $SERVER,
+                                               'subject' => 'tablespace',
+                                               'tablespace' => $this->_tableSpaceName))
+                                       );
        
         // Grant with no privileges selected.
         $this->assertTrue($this->clickLink($lang['strgrant']));
@@ -136,12 +143,15 @@ class TableSpacesTest extends PreconditionSet
     {
         global $webUrl;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the privileges page.
-        $this->assertTrue($this->get($webUrl . '/privileges.php'));
-        $this->assertTrue($this->get($webUrl . '/privileges.php?subject=tablespace' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
+        $this->assertTrue($this->get("$webUrl/privileges.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/privileges.php", array(
+                                   'server' => $SERVER,
+                                               'subject' => 'tablespace',
+                                               'tablespace' => $this->_tableSpaceName))
+                                       );
        
         // Revoke with no users selected.
         $this->assertTrue($this->clickLink($lang['strrevoke']));
@@ -165,12 +175,15 @@ class TableSpacesTest extends PreconditionSet
     {
         global $webUrl;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the privileges page.
-        $this->assertTrue($this->get($webUrl . '/privileges.php'));
-        $this->assertTrue($this->get($webUrl . '/privileges.php?subject=tablespace' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
+        $this->assertTrue($this->get("$webUrl/privileges.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/privileges.php", array(
+                                   'server' => $SERVER,
+                                               'subject' => 'tablespace',
+                                               'tablespace' => $this->_tableSpaceName))
+               );
        
         // Grant whit no privilege selected.
         $this->assertTrue($this->clickLink($lang['strgrant']));
@@ -191,12 +204,15 @@ class TableSpacesTest extends PreconditionSet
     {
         global $webUrl;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the privileges page.
-        $this->assertTrue($this->get($webUrl . '/privileges.php'));
-        $this->assertTrue($this->get($webUrl . '/privileges.php?subject=tablespace' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
+        $this->assertTrue($this->get("$webUrl/privileges.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/privileges.php", array(
+                                   'server' => $SERVER,
+                                               'subject' => 'tablespace',
+                                               'tablespace' => $this->_tableSpaceName))
+               );
        
         // Revoke whit no users selected.
         $this->assertTrue($this->clickLink($lang['strrevoke']));
@@ -216,13 +232,16 @@ class TableSpacesTest extends PreconditionSet
     function testDrop() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the drop user page.
-        $this->assertTrue($this->get($webUrl . '/tablespaces.php'));
-        $this->assertTrue($this->get($webUrl . '/tablespaces.php?action=confirm_drop' . 
-                                     '&tablespace=' . $this->_tableSpaceName));
-       
+        $this->assertTrue($this->get("$webUrl/tablespaces.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/tablespaces.php", array(
+                                   'server' => $SERVER,
+                                               'action' => 'confirm_drop',
+                                               'tablespace' => $this->_tableSpaceName))
+               );
+
         // Confirm to drop the user and verify it.
         $this->assertTrue($this->clickSubmit($lang['strdrop']));
         $this->assertWantedText($lang['strtablespacedropped']);
index f4cd59771613b48210aecd9b058da9666107ae9b..159075f80a38731c24cd815190a0c3283a76dc9f 100644 (file)
@@ -8,10 +8,7 @@
  */
 
 // Import the precondition class.
-if(is_dir('../Public')) 
-{
-    require_once('../Public/SetPrecondition.php');
-}
+require_once('Public/SetPrecondition.php');
 
 /**
  * This class is to test the user management.
@@ -22,27 +19,23 @@ class UsersTest extends PreconditionSet
     // Declare the user names which are created, altered and dropped in the class.
     private $_superUserName = "superuser";
     private $_powerUserName = "poweruser";
-    
+
     function setUp()
     {
-        global $webUrl;
-        global $SUPER_USER_NAME;
-        global $SUPER_USER_PASSWORD;
-        
-        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, $webUrl . '/index.php');
-        
+        global $webUrl, $SUPER_USER_NAME, $SUPER_USER_PASSWORD, $SERVER;
+
+        $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, "$webUrl/login.php");
         return TRUE;
     }
-    
-    
+
     function tearDown()
     {
         $this->logout();
         
         return TRUE;
     }
-   
-   
+
     /*
      * TestCaseID: SCU01
      * Test to create super user.
@@ -50,12 +43,13 @@ class UsersTest extends PreconditionSet
     function testCreateSuper() 
     {
         global $webUrl;
-        global $lang;
-        
+        global $lang, $SERVER;
+
         // Turn to the "Create user" page.
-        $this->assertTrue($this->get($webUrl . '/users.php'));
-        $this->assertTrue($this->clickLink($lang['strcreateuser']));
-       
+               $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
+
+               $this->assertTrue($this->clickLink($lang['strcreateuser']));
+
         // Enter information for creating a user.
         $this->assertTrue($this->setField('formUsername', $this->_superUserName));
         $this->assertTrue($this->setField('formPassword', '123456'));
@@ -77,22 +71,22 @@ class UsersTest extends PreconditionSet
     function testCreatePower() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the "Create user" page.
-        $this->assertTrue($this->get($webUrl . '/users.php'));
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
         $this->assertTrue($this->clickLink($lang['strcreateuser']));
-       
+
         // Enter information for creating a user.
         $this->assertTrue($this->setField('formUsername', $this->_powerUserName));
         $this->assertTrue($this->setField('formPassword', '123456'));
         $this->assertTrue($this->setField('formConfirm', '123456'));
         $this->assertTrue($this->setField('formCreateDB', TRUE));
-       
+
         //Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['strcreate']));
         $this->assertWantedText($this->_powerUserName);
-        
+
         return TRUE;
     }
     
@@ -106,10 +100,10 @@ class UsersTest extends PreconditionSet
         global $SUPER_USER_NAME;
         global $POWER_USER_NAME;
         global $NORMAL_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Get the users list page and verify it.
-        $this->assertTrue($this->get($webUrl . '/users.php'));
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
         $this->assertWantedText($SUPER_USER_NAME);
         $this->assertWantedText($POWER_USER_NAME);
         $this->assertWantedText($NORMAL_USER_NAME);
@@ -125,28 +119,30 @@ class UsersTest extends PreconditionSet
     function testAlter() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the "alter user" page.
-        $this->assertTrue($this->get($webUrl . '/users.php'));
-        $this->assertTrue($this->get($webUrl . '/users.php?action=edit' . 
-                          '&&username=' . $this->_superUserName));
-       
+        $this->assertTrue($this->get("$webUrl/users.php"));
+               $this->assertTrue($this->get("$webUrl/users.php", array(
+                                       'action' => 'edit',
+                                       'username' => $this->_superUserName,
+                                       'server' => $SERVER))
+               );
+
         // Enter the information for altering the user's properties.
         $this->assertTrue($this->setField('newname', $this->_superUserName));
         $this->assertTrue($this->setField('formPassword', '56789'));
         $this->assertTrue($this->setField('formConfirm', '56789'));
         $this->assertTrue($this->setField('formSuper', TRUE));
         $this->assertTrue($this->setField('formCreateDB', FALSE));
-       
+
         // Then submit and verify it.
         $this->assertTrue($this->clickSubmit($lang['stralter']));
         $this->assertWantedText($this->_superUserName);
-        
+
         return TRUE;
-    }
-    
-    
+    }    
+
     /*
      * TestCaseID: SDU01
      * Test to drop existing user.
@@ -154,20 +150,23 @@ class UsersTest extends PreconditionSet
     function testDrop() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the drop user page..
-        $this->assertTrue($this->get($webUrl . '/users.php'));
-        $this->assertTrue($this->get($webUrl . '/users.php?action=confirm_drop' . 
-                          '&&username=' . $this->_superUserName));
-       
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/users.php", array(
+                               'action' => 'confirm_drop',
+                               'username' => $this->_superUserName,
+                               'server' => $SERVER))
+               );
+
         // Confirm to drop the user and verify it.        
         $this->assertTrue($this->clickSubmit($lang['strdrop']));
         $this->assertNoUnWantedText($this->_superUserName);
-        
+
         return TRUE;
     }
-    
+
     /*
      * TestCaseID: SDU02
      * Test to drop existing user when the user is login.
@@ -175,34 +174,37 @@ class UsersTest extends PreconditionSet
     function testDropLogin() 
     {
         global $webUrl;
-        global $lang;
+        global $lang, $SERVER;
 
         // Create a new browser to login the power user which we want to drop.
         $newBrowser = $this->createBrowser();
-        $newBrowser->get($webUrl . '/index.php');
-        $this->assertTrue($newBrowser->setField('formUsername', $this->_powerUserName));
-        $this->assertTrue($newBrowser->setField('formPassword', '123456'));
+               $newBrowser->get("$webUrl/login.php", array('server' => $SERVER));
+        $this->assertTrue($newBrowser->setField('loginUsername', $this->_powerUserName));
+        $this->assertTrue($newBrowser->setFieldById('loginPassword', '123456'));
         $this->assertTrue($newBrowser->clickSubmit('Login'));
-        $this->assertTrue($newBrowser->get($webUrl . '/all_db.php'));
-        
+        $this->assertTrue($newBrowser->get("$webUrl/all_db.php", array('server' => $SERVER)));
+
         // Turn to the old browser which we login with super user at very beginning.
-        $this->assertTrue($this->get($webUrl . '/users.php'));
-        $this->assertTrue($this->get($webUrl . '/users.php?action=confirm_drop' . 
-                          '&&username=' . $this->_powerUserName));
-       
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/users.php", array('action' => 'confirm_drop',
+                               'username' => $this->_powerUserName,
+                               'server' => $SERVER))
+               );
+
         // Confirm to drop the user and verify it.      
         $this->assertTrue($this->clickSubmit($lang['strdrop']));
         $this->assertNoUnWantedText($this->_powerUserName);
 
         // Go back to the power user browser and try to create the database. 
         // It will log out and $lang['strloginfailed'] will be displayed in the page.
-        $this->setBrowser($newBrowser);
+               $this->setBrowser($newBrowser);
+
         $this->assertTrue($this->clickLink($lang['strcreatedatabase']));
         $this->assertWantedText($lang['strloginfailed']);
         
         return TRUE;
     }
-    
+
     /*
      * TestCaseID: SDU03
      * Test to drop the user self.
@@ -211,18 +213,21 @@ class UsersTest extends PreconditionSet
     {
         global $webUrl;
         global $SUPER_USER_NAME;
-        global $lang;
+        global $lang, $SERVER;
         
         // Turn to the drop user page..
-        $this->assertTrue($this->get($webUrl . '/users.php'));
-        $this->assertTrue($this->get($webUrl . '/users.php?action=confirm_drop' . 
-                          '&&username=' . $SUPER_USER_NAME));
-       
+        $this->assertTrue($this->get("$webUrl/users.php", array('server' => $SERVER)));
+               $this->assertTrue($this->get("$webUrl/users.php", array(
+                               'action' => 'confirm_drop',
+                               'username' => $SUPER_USER_NAME,
+                               'server' => $SERVER     ))
+               );
+
         // Confirm to drop the user and verify it.        
         $this->assertTrue($this->clickSubmit($lang['strdrop']));
         $this->assertWantedText($SUPER_USER_NAME);
         $this->assertWantedText($lang['struserdroppedbad']);
-        
+
         return TRUE;
     }
 }
index 9f3f78be8c13a309191cc3f030d9877770b7dd22..946e8cc225f9db8e6ad63b7a1694f0fc6780064b 100644 (file)
@@ -29,20 +29,20 @@ class ColumnTest extends PreconditionSet{
         global $POWER_USER_PASSWORD;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
-        \r
+                     "$webUrl/login.php"); \r
+\r
         return TRUE;\r
     }\r
-    \r
+\r
     /**\r
      * Clean up all the result. \r
      */ \r
     function tearDown(){\r
         $this->logout(); \r
-        \r
+\r
         return TRUE;\r
     }    \r
-    \r
+\r
     /**\r
      * TestCaseID: TNC01\r
      * Add a column to the table\r
@@ -50,11 +50,16 @@ class ColumnTest extends PreconditionSet{
     function testAddColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=add_column&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php",\r
+                       array('action' => 'add_column',\r
+                               'database' => $DATABASE,\r
+                               'schema' => 'public',\r
+                               'table' => 'student',\r
+                               'server' => $SERVER))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -75,23 +80,27 @@ class ColumnTest extends PreconditionSet{
     function testAddColumnWithExistingName()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
+        global $lang, $SERVER, $DATABASE;\r
+\r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=add_column&database=test&schema=public&table=student'));\r
-        \r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_column',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
+\r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
         $this->assertTrue($this->setField('type', 'integer'));                \r
         $this->assertTrue($this->clickSubmit($lang['stradd']));\r
-        \r
+\r
         // Make sure the operation failed\r
         $this->assertTrue($this->assertWantedText($lang['strcolumnaddedbad']));\r
-        \r
+\r
         return TRUE;               \r
-    }\r
-    \r
+    }    \r
     \r
     /**\r
      * TestCaseID: TNC03\r
@@ -100,11 +109,16 @@ class ColumnTest extends PreconditionSet{
     function testCancelAddColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=add_column&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_column',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -122,12 +136,17 @@ class ColumnTest extends PreconditionSet{
     function testAlterColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=properties&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'properties',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -149,12 +168,17 @@ class ColumnTest extends PreconditionSet{
     function testNegativeLengthColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=properties&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'properties',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -176,12 +200,17 @@ class ColumnTest extends PreconditionSet{
     function testCancelAlterColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=properties&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'properties',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -200,12 +229,17 @@ class ColumnTest extends PreconditionSet{
     function testCancelDropColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the column\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE, \r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strcancel']));\r
         \r
         return TRUE; \r
@@ -219,12 +253,17 @@ class ColumnTest extends PreconditionSet{
     function testDropColumn()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the column\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify if the column is dropped correctly.\r
         $this->assertTrue($this->assertWantedText($lang['strcolumndropped']));\r
@@ -240,13 +279,18 @@ class ColumnTest extends PreconditionSet{
     function testDropColumnWithCascade()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         global $POWER_USER_NAME;\r
         global $POWER_USER_PASSWORD;        \r
         \r
         // Go to the Columns page\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=add_column&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_column',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
@@ -258,13 +302,17 @@ class ColumnTest extends PreconditionSet{
         \r
         $this->logout();        \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');        \r
-        \r
+                     "$webUrl/login.php");        \r
         \r
         // Drop the column with CASCADE checked\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php" , array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         $this->assertTrue($this->setField('cascade', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify if the column is dropped correctly.\r
@@ -273,7 +321,4 @@ class ColumnTest extends PreconditionSet{
         return TRUE;  \r
     }                       \r
 }\r
-        \r
-    \r
-    \r
-\r
+?>\r
index 7eac3cebb55620cd10c888d5be2505842326894c..dc7c0058c95fe61f95e4f3f2461b38e0e2c589e3 100644 (file)
@@ -29,7 +29,7 @@ class ConstraintsTest extends PreconditionSet{
         global $SUPER_USER_PASSWORD;\r
         \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;\r
     }\r
@@ -49,11 +49,16 @@ class ConstraintsTest extends PreconditionSet{
      */\r
     function testAddCheck(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the constraints page\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=add_check&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_check',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new constraint    \r
         $this->assertTrue($this->setField('name', 'id_check'));\r
@@ -75,11 +80,17 @@ class ConstraintsTest extends PreconditionSet{
     function testDropCheckKey()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
-        \r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&constraint=id_check&type=c'));\r
+        global $lang, $SERVER, $DATABASE;\r
+        \r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'constraint' => 'id_check',\r
+                       'type' => 'c'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify if the constraint is dropped correctly.\r
         $this->assertTrue($this->assertWantedText($lang['strconstraintdropped']));\r
@@ -94,12 +105,16 @@ class ConstraintsTest extends PreconditionSet{
      */\r
     function testAddUniqueKey(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the constraints page\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=add_unique_key&database=test&' .\r
-                                     'schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_unique_key',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new constraint    \r
         $this->assertTrue($this->setField('name', 'unique_name'));\r
@@ -122,11 +137,14 @@ class ConstraintsTest extends PreconditionSet{
     function testDropUniqueKey()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&constraint=unique_name'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER, 'action' => 'confirm_drop',\r
+                       'database' => $DATABASE, 'schema' => 'public',\r
+                       'table' => 'student', 'constraint' => 'unique_name'))\r
+               );\r
+\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify if the constraint is dropped correctly.\r
         $this->assertTrue($this->assertWantedText($lang['strconstraintdropped']));\r
@@ -141,12 +159,14 @@ class ConstraintsTest extends PreconditionSet{
      */\r
     function testAddPrimaryKey(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the constraints page\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=add_primary_key&database=test&schema=public&' .\r
-                                     'table=college_student'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER, 'action' => 'add_primary_key',\r
+                       'database' => $DATABASE, 'schema' => 'public',\r
+                       'table' => 'college_student'))\r
+               );\r
         \r
         // Set properties for the new constraint    \r
         $this->assertTrue($this->setField('name', 'primary_id'));\r
@@ -170,12 +190,14 @@ class ConstraintsTest extends PreconditionSet{
     function testDropPrimaryKey()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Remove the primary key\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=college_student&constraint=primary_id&type=p'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER, 'action' => 'confirm_drop', 'database' => $DATABASE,\r
+                       'schema' => 'public', 'table' => 'college_student', 'constraint' => 'primary_id',\r
+                       'type' => 'p'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         $this->assertTrue($this->assertWantedText($lang['strconstraintdropped']));\r
         \r
@@ -189,12 +211,13 @@ class ConstraintsTest extends PreconditionSet{
      */\r
     function testAddForeignKey(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the constraints page\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=add_foreign_key&database=test&' .\r
-                                     'schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER, 'action' => 'add_foreign_key', 'database' => $DATABASE,\r
+                       'schema' => 'public', 'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new constraint    \r
         $this->assertTrue($this->setField('name', 'foreign_id'));\r
@@ -225,15 +248,18 @@ class ConstraintsTest extends PreconditionSet{
     function testDropForeignKey()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Remove the foreign key\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&constraint=foreign_id&type=f'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER, 'action' => 'confirm_drop', 'database' => $DATABASE,\r
+                       'schema' => 'public', 'table' => 'student', 'constraint' => 'foreign_id',\r
+                       'type' => 'f'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         $this->assertTrue($this->assertWantedText($lang['strconstraintdropped']));\r
         \r
         return TRUE; \r
     }\r
 }\r
+?>\r
index 772b8e43c319f2aaf995448298c3c37bb6a76473..7a830b65addba69c3bc9107bde0e36b44bda8eea 100644 (file)
@@ -54,7 +54,7 @@ class DeadlockTest extends PreconditionSet{
     function testAddCheckScenario()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         global $POWER_USER_PASSWORD;\r
         global $SUPER_USER_PASSWORD;\r
         global $SUPER_USER_NAME;\r
@@ -62,12 +62,17 @@ class DeadlockTest extends PreconditionSet{
         \r
 \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         \r
         // Try to add a check constraint to the table student\r
         // Go to the constraints page\r
-        $this->assertTrue($this->get($webUrl . '/constraints.php?' .\r
-                                     'action=add_check&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/constraints.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_check',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new constraint    \r
         $this->assertTrue($this->setField('name', 'id_check'));\r
@@ -76,16 +81,19 @@ class DeadlockTest extends PreconditionSet{
         \r
         // Open the second session, login as superuser\r
         $newBrowser = $this->createBrowser();\r
-        $newBrowser->get($webUrl . '/index.php');        \r
+        $newBrowser->get("$webUrl/login.php"); \r
         $this->assertTrue($newBrowser->setField('formUsername', $SUPER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', $SUPER_USER_PASSWORD));\r
         $this->assertTrue($newBrowser->setField('formLanguage', $lang['applang']));\r
         $this->assertTrue($newBrowser->clickSubmit('Login'));\r
                      \r
         // Alter the user's password\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php'));\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php?action=edit' . \r
-                                           '&&username=' . $POWER_USER_NAME));       \r
+        $this->assertTrue($newBrowser->get("$webUrl/users.php"));\r
+               $this->assertTrue($newBrowser->get("$webUrl/users.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'edit',\r
+                       'username' => $POWER_USER_NAME))\r
+               );       \r
         // Enter the information for altering the user's properties.\r
         $this->assertTrue($newBrowser->setField('newname', $POWER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', '56789'));\r
@@ -102,9 +110,12 @@ class DeadlockTest extends PreconditionSet{
         \r
         \r
         // Rollback the changes to return to the original state\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php'));\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php?action=edit' . \r
-                                           '&&username=' . $POWER_USER_NAME));\r
+        $this->assertTrue($newBrowser->get("$webUrl/users.php"));\r
+               $this->assertTrue($newBrowser->get("$webUrl/users.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'edit',\r
+                       'username' => $POWER_USER_NAME))\r
+               );\r
        \r
         // Change back the user's password\r
         $this->assertTrue($newBrowser->setField('newname', $POWER_USER_NAME));\r
@@ -135,34 +146,40 @@ class DeadlockTest extends PreconditionSet{
     function testCreateDatabaseScenario()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER;\r
         global $POWER_USER_PASSWORD;\r
         global $SUPER_USER_PASSWORD;\r
         global $SUPER_USER_NAME;\r
         global $POWER_USER_NAME;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         \r
         // Try to create a database 'newdb', without commit the operation                 \r
-        $this->assertTrue ($this->get ($webUrl . '/all_db.php'));              \r
-        $this->assertTrue ($this->get ($webUrl . '/all_db.php?action=create'));       \r
+        $this->assertTrue ($this->get ("$webUrl/all_db.php"));              \r
+               $this->assertTrue ($this->get ("$webUrl/all_db.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create'))\r
+               );       \r
         $this->assertTrue ($this->setfield('formName', 'newdb'));\r
         $this->assertTrue ($this->setfield('formEncoding', 'UNICODE'));                      \r
         \r
         \r
         // Open another session, login as superuser\r
         $newBrowser = $this->createBrowser();\r
-        $newBrowser->get($webUrl . '/index.php');        \r
+        $newBrowser->get("$webUrl/login.php");\r
         $this->assertTrue($newBrowser->setField('formUsername', $SUPER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', $SUPER_USER_PASSWORD));\r
         $this->assertTrue($newBrowser->setField('formLanguage', $lang['applang']));\r
         $this->assertTrue($newBrowser->clickSubmit('Login'));\r
                      \r
         // Revoke the user's createdb privilege\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php'));\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php?action=edit' . \r
-                                           '&&username=' . $POWER_USER_NAME));\r
+        $this->assertTrue($newBrowser->get("$webUrl/users.php"));\r
+               $this->assertTrue($newBrowser->get("$webUrl/users.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'edit',\r
+                       'username' => $POWER_USER_NAME))\r
+               );\r
         $this->assertTrue($newBrowser->setField('newname', $POWER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', 'tester'));\r
         $this->assertTrue($newBrowser->setField('formConfirm', 'tester'));\r
@@ -177,9 +194,13 @@ class DeadlockTest extends PreconditionSet{
         $this->assertTrue ($this->assertWantedText($lang['strdatabasecreatedbad']));\r
           \r
         // Rollback the changes to return to the original state\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php'));\r
-        $this->assertTrue($newBrowser->get($webUrl . '/users.php?action=edit' . \r
-                                           '&&username=' . $POWER_USER_NAME));  \r
+        $this->assertTrue($newBrowser->get("$webUrl/users.php"));\r
+               $this->assertTrue($newBrowser->get("$webUrl/users.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'edit',\r
+                       'username' => $POWER_USER_NAME))\r
+               );\r
+\r
         $this->assertTrue($newBrowser->setField('newname', $POWER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', $POWER_USER_PASSWORD));\r
         $this->assertTrue($newBrowser->setField('formConfirm', $POWER_USER_PASSWORD));\r
@@ -190,7 +211,6 @@ class DeadlockTest extends PreconditionSet{
         return TRUE;\r
     }\r
     \r
-    \r
     /**\r
      * TestCaseID: TET02\r
      * \r
@@ -205,18 +225,23 @@ class DeadlockTest extends PreconditionSet{
     function testDropColumnScenario()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         global $POWER_USER_PASSWORD;\r
         global $SUPER_USER_PASSWORD;\r
         global $SUPER_USER_NAME;\r
         global $POWER_USER_NAME;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         \r
         // Add a column "sid"\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-            'action=add_column&database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'add_column',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'sid'));        \r
         $this->assertTrue($this->setField('type', 'integer'));                \r
@@ -226,9 +251,14 @@ class DeadlockTest extends PreconditionSet{
         \r
         \r
         // Try to alter the column as "ssid"\r
-        $this->assertTrue($this->get($webUrl . '/tblproperties.php?&' .\r
-                                     'action=properties&database=test&schema=public&' .\r
-                                     'table=student&column=sid'));    \r
+               $this->assertTrue($this->get("$webUrl/tblproperties.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'properties',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         // Set properties for the new column    \r
         $this->assertTrue($this->setField('field', 'ssid'));        \r
         $this->assertTrue($this->setField('type', 'character')); \r
@@ -237,16 +267,21 @@ class DeadlockTest extends PreconditionSet{
         \r
         // Open the second session, login as power user\r
         $newBrowser = $this->createBrowser();\r
-        $newBrowser->get($webUrl . '/index.php');        \r
+        $newBrowser->get("$webUrl/login.php"); \r
         $this->assertTrue($newBrowser->setField('formUsername', $POWER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', $POWER_USER_PASSWORD));\r
         $this->assertTrue($newBrowser->setField('formLanguage', $lang['applang']));\r
         $this->assertTrue($newBrowser->clickSubmit('Login'));\r
-                     \r
+\r
         // Drop the column\r
-        $this->assertTrue($newBrowser->get($webUrl . '/tblproperties.php?' .\r
-                                           'action=confirm_drop&database=test&schema=public&' .\r
-                                           'table=student&column=sid'));\r
+               $this->assertTrue($newBrowser->get("$webUrl/tblproperties.php", array(\r
+                   'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student',\r
+                       'column' => 'sid'))\r
+               );\r
         $this->assertTrue($newBrowser->clickSubmit($lang['strdrop']));\r
         \r
         \r
@@ -273,17 +308,21 @@ class DeadlockTest extends PreconditionSet{
     function testQueryDroppedTable()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         global $POWER_USER_PASSWORD;\r
         global $SUPER_USER_PASSWORD;\r
         global $SUPER_USER_NAME;\r
         global $POWER_USER_NAME;\r
 \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         // Create a table.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?action=create&' .\r
-                                     'database=test&schema=public'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public'))\r
+               );\r
         \r
         // Enter the table name and field number.\r
         $this->assertTrue($this->setField('name', 'newtable'));        \r
@@ -314,9 +353,13 @@ class DeadlockTest extends PreconditionSet{
         // Issue a SELECT query\r
         \r
         // Turn to the "tables" page.\r
-        $this->assertTrue($this->get($webUrl . '/tables.php?&' .\r
-                                     'action=confselectrows&database=test&' .\r
-                                     'schema=public&table=newtable'));\r
+               $this->assertTrue($this->get("$webUrl/tables.php", array(\r
+                   'server' => $SERVER,\r
+                       'action' => 'confselectrows',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'newtable'))\r
+               );\r
         \r
         // Select all the rows.\r
         $this->assertTrue($this->setField('show[firstfield]', TRUE));\r
@@ -325,15 +368,20 @@ class DeadlockTest extends PreconditionSet{
         \r
         // Open another session, login as super user, drop the table "newtable"\r
         $newBrowser = $this->createBrowser();\r
-        $newBrowser->get($webUrl . '/index.php');        \r
+        $newBrowser->get("$webUrl/login.php");\r
         $this->assertTrue($newBrowser->setField('formUsername', $SUPER_USER_NAME));\r
         $this->assertTrue($newBrowser->setField('formPassword', $SUPER_USER_PASSWORD));\r
         $this->assertTrue($newBrowser->setField('formLanguage', $lang['applang']));\r
         $this->assertTrue($newBrowser->clickSubmit('Login'));\r
                      \r
         // Drop the table\r
-        $newBrowser->get($webUrl . '/tables.php?action=confirm_drop&' . \r
-                         'database=test&schema=public&table=newtable'); \r
+               $newBrowser->get("$webUrl/tables.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'newtable')\r
+               ); \r
         $this->assertTrue($newBrowser->clickSubmit($lang['strdrop']));\r
         \r
         \r
@@ -348,3 +396,4 @@ class DeadlockTest extends PreconditionSet{
         return TRUE;\r
     }\r
 }\r
+?>\r
index 2584a9c2b7c9ec177cdbdfa97e799f70cca71194..d0b0c34d5e899815d4818b80e0b499d9beddb216 100644 (file)
@@ -29,7 +29,7 @@ class IndexesTest extends PreconditionSet{
         global $SUPER_USER_NAME;\r
         \r
         $this->login($SUPER_USER_NAME, $SUPER_USER_NAME, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php");\r
         \r
         return TRUE;\r
     }\r
@@ -49,12 +49,16 @@ class IndexesTest extends PreconditionSet{
      */\r
     function testCreateIndex(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Indexes page\r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?&' .\r
-                                     'action=create_index&database=test&' .\r
-                                     'schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                       'server' => $SERVER,\r
+                       'action' => 'create_index',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'student'))\r
+               );\r
         \r
         // Set properties for the new index    \r
         $this->assertTrue($this->setField('formIndexName', 'stu_name_idx'));\r
@@ -79,12 +83,16 @@ class IndexesTest extends PreconditionSet{
      */\r
     function testCancelCreateIndex(){\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Indexes page\r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?&' .\r
-                                     'action=create_index&database=test' .\r
-                                     '&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student'))\r
+                                       );\r
         \r
         // Set properties for the new index    \r
         $this->assertTrue($this->setField('formIndexName', 'stu_name_idx'));\r
@@ -106,12 +114,17 @@ class IndexesTest extends PreconditionSet{
     function testReindex()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Indexes page\r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?action=reindex&' .\r
-                                     'database=test&schema=public&table=student&' .\r
-                                     'index=stu_name_idx'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'reindex',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'index' => 'stu_name_idx'))\r
+                                       );\r
         \r
         // Verify if the index is reindexed correctly.\r
         $this->assertTrue($this->assertWantedText($lang['strreindexgood']));\r
@@ -127,11 +140,16 @@ class IndexesTest extends PreconditionSet{
     function testClusterPrimaryKeyWithAnalyze()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?' .\r
-                                     'action=confirm_cluster_index&database=test&schema=public&' .\r
-                                     'table=student&index=student_pkey'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_cluster_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'index' => 'student_pkey'))\r
+                                       );\r
         $this->assertTrue($this->setField('analyze', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strcluster'])); \r
         // Verify if the key is clustered correctly. \r
@@ -149,11 +167,16 @@ class IndexesTest extends PreconditionSet{
     function testClusterPrimaryKeyWithoutAnalyze()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?' .\r
-                                     'action=confirm_cluster_index&database=test&schema=public&' .\r
-                                     'table=student&index=student_pkey'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_cluster_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'index' => 'student_pkey'))\r
+                                       );\r
         $this->assertTrue($this->setField('analyze', FALSE));\r
         $this->assertTrue($this->clickSubmit($lang['strcluster']));\r
         // Verify if the key is clustered correctly.\r
@@ -170,19 +193,22 @@ class IndexesTest extends PreconditionSet{
     function testCancelCluster()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?' .\r
-                                     'action=confirm_cluster_index&database=test&schema=public&' .\r
-                                     'table=student&constraint=student_pkey'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_cluster_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'constraint' => 'student_pkey'))\r
+                                       );\r
         $this->assertTrue($this->setField('analyze', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strcancel']));\r
         \r
         return TRUE; \r
     }\r
-    \r
-    \r
-    \r
+\r
     /**\r
      * TestCaseID: TDI02\r
      * Cancel dropping an index in a table\r
@@ -190,18 +216,22 @@ class IndexesTest extends PreconditionSet{
     function testCancelDropIndex()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?' .\r
-                                     'action=confirm_drop_index&database=test&schema=public&' .\r
-                                     'table=student&index=stu_name_idx'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'index' => 'stu_name_idx'))\r
+                                       );\r
         $this->assertField($this->setField('cascade', FALSE));\r
         $this->assertTrue($this->clickSubmit($lang['strcancel']));\r
         \r
         return TRUE; \r
     }\r
-    \r
-    \r
+\r
     /**\r
      * TestCaseID: TDI01\r
      * Test dropping an index in a table\r
@@ -209,11 +239,16 @@ class IndexesTest extends PreconditionSet{
     function testDropIndex()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
-        $this->assertTrue($this->get($webUrl . '/indexes.php?' .\r
-                                     'action=confirm_drop_index&database=test&schema=public&' .\r
-                                     'table=student&index=stu_name_idx'));\r
+               $this->assertTrue($this->get("$webUrl/indexes.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop_index',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'index' => 'stu_name_idx'))\r
+                                       );\r
         $this->assertField($this->setField('cascade', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['strdrop']));\r
         // Verify if the index is dropped correctly.\r
index f85261f4124fd5cde71800f9d72685ff4d17ffa5..936b8881e22be194c2077aefa6fb331aeca25fb2 100644 (file)
@@ -29,7 +29,7 @@ class InfoTest extends PreconditionSet{
         global $POWER_USER_PASSWORD;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php");\r
         \r
         return TRUE;\r
     }\r
@@ -50,11 +50,16 @@ class InfoTest extends PreconditionSet{
     function testListParentTableInfo()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/info.php?&' .\r
-                                     'database=test&schema=public&table=student&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/info.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'subject' => 'table'))\r
+                                       );\r
         \r
         return TRUE;            \r
     }\r
@@ -67,11 +72,16 @@ class InfoTest extends PreconditionSet{
     function testListChildrenTableInfo()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/info.php?&database=test&' .\r
-                                     'schema=public&table=college_student&subject=table')); \r
+               $this->assertTrue($this->get("$webUrl/info.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'college_student',\r
+                                               'subject' => 'table'))\r
+                                       ); \r
         \r
         return TRUE;          \r
     }\r
@@ -84,17 +94,20 @@ class InfoTest extends PreconditionSet{
     function testListForeignTableInfo()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/info.php?&' .\r
-                                     'database=test&schema=public&' .\r
-                                     'table=department&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/info.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'department',\r
+                                               'subject' => 'table'))\r
+                                       );\r
         \r
-        return TRUE;           \r
-    }    \r
-    \r
-    \r
+        return TRUE;\r
+    }\r
+\r
     /**\r
      * TestCaseID: TSP01\r
      * Show the properties of the foreign key constraint\r
@@ -102,12 +115,16 @@ class InfoTest extends PreconditionSet{
     function testShowForeignKeyProperties()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/info.php?&' .\r
-                                     'database=test&schema=public&' .\r
-                                     'table=department&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/info.php?", array(\r
+            'server' => $SERVER,\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'table' => 'department',\r
+                       'subject' => 'table'))\r
+               );\r
              \r
         $this->assertTrue($this->clickLink($lang['strproperties']));\r
         $this->assertWantedText('FOREIGN KEY (dep_id) REFERENCES department(id) ' . \r
@@ -116,7 +133,4 @@ class InfoTest extends PreconditionSet{
         return TRUE;         \r
     }    \r
 }\r
-        \r
-    \r
-    \r
-\r
+?>\r
index aeff6bdcfc06a1ab7ca8dbbd760de83edf6a0187..57330599e93f7783593b5bfba6aab28a3be354f7 100644 (file)
@@ -28,7 +28,7 @@ class RulesTest extends PreconditionSet{
         global $POWER_USER_PASSWORD;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;\r
     }\r
@@ -49,12 +49,17 @@ class RulesTest extends PreconditionSet{
     function testCreateRule()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?&' .\r
-                                     'action=create_rule&database=test&schema=public&' .\r
-                                     'table=student&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create_rule',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'subject' => 'table'))\r
+                                       );\r
         \r
         // Set properties for the new rule    \r
         $this->assertTrue($this->setField('name', 'insert_stu_rule'));     \r
@@ -77,12 +82,17 @@ class RulesTest extends PreconditionSet{
     function testCancelCreateRule()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?&' .\r
-                                     'action=create_rule&database=test&schema=public&' .\r
-                                     'table=student&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create_rule',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'subject' => 'table'))\r
+                                       );\r
         \r
         // Set properties for the new rule    \r
         $this->assertTrue($this->setField('name', 'insert_stu_rule'));     \r
@@ -102,12 +112,19 @@ class RulesTest extends PreconditionSet{
     function testCancelDropRule()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the rule\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&reltype=table&' .\r
-                                     'table=student&subject=rule&rule=insert_stu_rule'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+            'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'reltype' => 'table',\r
+                       'table' => 'student',\r
+                       'subject' => 'rule',\r
+                       'rule' => 'insert_stu_rule'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['strno']));\r
         \r
         return TRUE;\r
@@ -120,12 +137,19 @@ class RulesTest extends PreconditionSet{
     function testDropRule()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the rule\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&reltype=table' .\r
-                                     '&table=student&subject=rule&rule=insert_stu_rule'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+            'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'reltype' => 'table',\r
+                       'table' => 'student',\r
+                       'subject' => 'rule',\r
+                       'rule' => 'insert_stu_rule'))\r
+               );\r
         $this->assertTrue($this->clickSubmit($lang['stryes']));\r
         // Verify if the rule is dropped correctly.\r
         $this->assertTrue($this->assertWantedText($lang['strruledropped']));\r
@@ -141,14 +165,19 @@ class RulesTest extends PreconditionSet{
     function testDropRuleWithCascade()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         global $POWER_USER_NAME;\r
         global $POWER_USER_PASSWORD;\r
         \r
         // Go to the Rules page\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?&' .\r
-                                     'action=create_rule&database=test&schema=public&' .\r
-                                     'table=student&subject=table'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create_rule',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'subject' => 'table'))\r
+                                       );\r
         \r
         // Set properties for the new rule    \r
         $this->assertTrue($this->setField('name', 'insert_stu_rule'));     \r
@@ -162,12 +191,19 @@ class RulesTest extends PreconditionSet{
         \r
         $this->logout();\r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php');\r
+                     "$webUrl/login.php");\r
         \r
         // Drop the rule\r
-        $this->assertTrue($this->get($webUrl . '/rules.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&reltype=table&' .\r
-                                     'table=student&subject=rule&rule=insert_stu_rule'));\r
+               $this->assertTrue($this->get("$webUrl/rules.php", array(\r
+            'server' => $SERVER,\r
+                       'action' => 'confirm_drop',\r
+                       'database' => $DATABASE,\r
+                       'schema' => 'public',\r
+                       'reltype' => 'table',\r
+                       'table' => 'student',\r
+                       'subject' => 'rule',\r
+                       'rule' => 'insert_stu_rule'))\r
+               );\r
         $this->assertTrue($this->setField('cascade', TRUE)); \r
         $this->assertTrue($this->clickSubmit($lang['stryes']));\r
         // Verify if the rule is dropped correctly.\r
@@ -176,7 +212,4 @@ class RulesTest extends PreconditionSet{
         return TRUE; \r
     }                        \r
 }\r
-        \r
-    \r
-    \r
-\r
+?>\r
index fbc18e6740f160302001fa88f596c768100f2665..5576d9b37388616060e7d0ce32628813013e1fb1 100644 (file)
@@ -11,8 +11,6 @@ if(is_dir('../Public'))
 {\r
     require_once('../Public/SetPrecondition.php');\r
 }\r
-//require_once('english.php');\r
-//require_once('../lang/english.php');\r
 \r
 /**\r
  * A test case suite for testing TRIGGER feature in phpPgAdmin, including cases\r
@@ -31,7 +29,7 @@ class TriggersTest extends PreconditionSet{
         global $POWER_USER_PASSWORD;\r
         \r
         $this->login($POWER_USER_NAME, $POWER_USER_PASSWORD, \r
-                     $webUrl . '/index.php'); \r
+                     "$webUrl/login.php"); \r
         \r
         return TRUE;\r
     }\r
@@ -52,11 +50,16 @@ class TriggersTest extends PreconditionSet{
     function testAddTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Triggers page\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?action=create&' .\r
-                                     'database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student'))\r
+                                       );\r
         \r
         // Set properties for the new trigger    \r
         $this->assertTrue($this->setField('formTriggerName', \r
@@ -82,11 +85,16 @@ class TriggersTest extends PreconditionSet{
     function testCancelAddTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Go to the Triggers page\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?action=create&' .\r
-                                     'database=test&schema=public&table=student'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'create',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student'))\r
+                                       );\r
         \r
         // Set properties for the new trigger    \r
         $this->assertTrue($this->setField('formTriggerName', \r
@@ -109,12 +117,17 @@ class TriggersTest extends PreconditionSet{
     function testAlterTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Alter the trigger\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?&' .\r
-                                     'action=confirm_alter&database=test&schema=public&' .\r
-                                     'table=student&trigger=insert_stu_trigger'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php" , array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_alter',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'trigger' => 'insert_stu_trigger'))\r
+                                       );\r
         $this->assertTrue($this->setField('name', 'changed_trigger'));\r
         $this->assertTrue($this->clickSubmit($lang['strok']));\r
         // Verify if the trigger is altered correctly.\r
@@ -131,19 +144,23 @@ class TriggersTest extends PreconditionSet{
     function testCancelAlterTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Alter the trigger\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?&' .\r
-                                     'action=confirm_alter&database=test&schema=public&' .\r
-                                     'table=student&trigger=changed_trigger'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_alter',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'trigger' => 'changed_trigger'))\r
+                                       );\r
         $this->assertTrue($this->setField('name', 'changed_trigger_changed'));\r
         $this->assertTrue($this->clickSubmit($lang['strcancel']));\r
-        \r
+\r
         return TRUE;\r
-    } \r
-    \r
-    \r
+    }     \r
+\r
     /**\r
      * TestCaseID: TDT01\r
      * Cancel dropping a trigger from the table\r
@@ -151,12 +168,17 @@ class TriggersTest extends PreconditionSet{
     function testCancelDropTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the trigger\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&trigger=changed_trigger'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php", array(\r
+                              'server' => $SERVER,\r
+                                          'action' => 'confirm_drop',\r
+                                          'database' => $DATABASE,\r
+                                          'schema' => 'public',\r
+                                          'table' => 'student',\r
+                                          'trigger' => 'changed_trigger'))\r
+                                  );\r
         $this->assertTrue($this->clickSubmit($lang['strno']));\r
         \r
         return TRUE;\r
@@ -170,12 +192,17 @@ class TriggersTest extends PreconditionSet{
     function testDropTrigger()\r
     {\r
         global $webUrl;\r
-        global $lang;\r
+        global $lang, $SERVER, $DATABASE;\r
         \r
         // Drop the trigger\r
-        $this->assertTrue($this->get($webUrl . '/triggers.php?' .\r
-                                     'action=confirm_drop&database=test&schema=public&' .\r
-                                     'table=student&trigger=changed_trigger'));\r
+               $this->assertTrue($this->get("$webUrl/triggers.php", array(\r
+                                   'server' => $SERVER,\r
+                                               'action' => 'confirm_drop',\r
+                                               'database' => $DATABASE,\r
+                                               'schema' => 'public',\r
+                                               'table' => 'student',\r
+                                               'trigger' => 'changed_trigger'))\r
+                                       );\r
         $this->assertTrue($this->setField('cascade', TRUE));\r
         $this->assertTrue($this->clickSubmit($lang['stryes']));\r
         // Verify if the trigger is dropped correctly.\r
@@ -184,7 +211,4 @@ class TriggersTest extends PreconditionSet{
         return TRUE; \r
     }                          \r
 }\r
-        \r
-    \r
-    \r
-\r
+?>\r
index 9018ad621c1057da46a80f793508b241c41d480e..3166bf071dddb2e81c331455bcf64c3d9af5abf4 100644 (file)
@@ -8,15 +8,10 @@
 \r
 // Import necessary library files to setup the testcase.\r
 // And for web testcase, the library web_tester.php shoule be included.\r
-require_once 'simpletest.inc.php';\r
-require_once 'simpletest/web_tester.php';\r
-require_once 'simpletest/reporter.php';\r
-require_once 'simpletest/reporter/DetailedHtmlReporter.php';\r
 \r
-// Import the language file for phpPgAdmi to avoid hard code.\r
-require_once('lang/recoded/english.php');\r
+require_once("$PHP_SIMPLETEST_HOME/web_tester.php");\r
+require_once("$PHP_SIMPLETEST_HOME/reporter.php");\r
 \r
-require_once('Public/common.php'); \r
 require_once('Public/SetPrecondition.php');  \r
 \r
 require_once('Server/ServerGroupTest.php');\r
@@ -33,16 +28,18 @@ class phpPgAdminGroupTest extends GroupTest
 {\r
     function phpPgAdminGroupTest() \r
     {\r
-        $this->GroupTest('phpPgAdmin automation test.');\r
+               $this->GroupTest('phpPgAdmin automation test.');\r
         $this->addTestClass(new ServerGroupTest());\r
         $this->addTestClass(new DatabaseGroupTest());\r
         $this->addTestClass(new SchemasGroupTest());\r
         $this->addTestClass(new TableGroupTest());\r
-        $this->addTestClass(new CommonGroupTest());\r
+               $this->addTestClass(new CommonGroupTest());\r
+\r
     }\r
 }\r
 \r
 $phpPgAdminTest = &new phpPgAdminGroupTest();\r
-$phpPgAdminTest->run(new DetailedHtmlReporter());\r
+\r
+$phpPgAdminTest->run(new HtmlReporter());\r
 \r
 ?>\r