Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

clean up directory lists, fix warnings when directory traversing, all…

…ow users to specify list of dbs to test, fix spelling on notice, clean up documentation, rewrite examples to be clearer, and set them using databases given in config.inc.php-dist.
  • Loading branch information...
commit 5a8939c73a7d11345714a2fa646003b89149f355 1 parent 8bbb3d6
@xzilla authored
Showing with 59 additions and 32 deletions.
  1. +15 −9 build_tests.php
  2. +44 −23 tests/selenium/config.test.php-dist
View
24 build_tests.php
@@ -8,19 +8,21 @@
require('./conf/config.inc.php');
$test_dir = './tests/selenium/';
- $test_src_dir = "{$test_dir}/src/";
- $test_static_dir = "{$test_dir}/static/";
- $testsuite_file = "{$test_static_dir}/TestSuite.html";
+ $test_src_dir = "{$test_dir}src/";
+ $test_static_dir = "{$test_dir}static/";
+ $testsuite_file = "{$test_static_dir}TestSuite.html";
if(isset($argv[1]) && ($argv[1] == 'clean')) {
echo "Cleaning...";
/* delete server directories */
foreach ($conf['servers'] as $server) {
- $dir = "{$test_static_dir}/{$server['desc']}";
- $dh = opendir($dir);
- while($file = readdir($dh))
- if (($file != '.') && ($file != '..')) unlink("{$dir}/{$file}");
- rmdir($dir);
+ $dir = "{$test_static_dir}{$server['desc']}";
+ while(is_dir($dir)) {
+ $dh = opendir($dir);
+ while($file = readdir($dh))
+ if (($file != '.') && ($file != '..')) unlink("{$dir}/{$file}");
+ rmdir($dir);
+ }
}
/* delete the TestSuite.html file */
@unlink($testsuite_file);
@@ -49,6 +51,10 @@
/* Loop on the servers given in the conf/config.inc.conf file */
foreach ($conf['servers'] as $server) {
+ // Is this server in our list of configured servers?
+ if (!in_array($server['desc'],$test_servers))
+ continue;
+
/* connect to the server to get its version
* and test its feature along the tests */
$_c = new Connection($server['host'],
@@ -61,7 +67,7 @@
$_type = $data = null;
if (! $_c->conn->isConnected())
- die ("Connexion to {$server['desc']} failed !\n");
+ die ("Connection to {$server['desc']} failed !\n");
else {
if (($_type = $_c->getDriver($platform)) === null) {
die( printf($lang['strpostgresqlversionnotsupported'], $postgresqlMinVer));
View
67 tests/selenium/config.test.php-dist
@@ -1,34 +1,55 @@
<?php
-/* Set this variable to the root URL of the tested PPA */
+// Set this variable to the root URL of the tested PPA
$webUrl = 'http://boox/~ioguix/ppa.git/phppgadmin';
-/* Associative array with the super user names for each configured server in your conf/config.inc.php :
-* $superuser = array(
-* the 'desc' part of the server in your conf/config.inc.php => the super user name,
-* ...
-* )
-* These profiles are only used to create the admin test role (or user) on each server.
+/* An Array of the servers you want to use for testing, based on the entries
+ found in your conf/config.inc.php file, matching the $server[n]['desc']
+ field. Once you have listed the server here, you need to make a
+ corresponding entry in the $super_user and $super_pass arrays that follow.
*/
-$super_user['7.3'] = $super_user['7.4'] = $super_user['8.0'] =
-$super_user['8.1'] = $super_user['8.2'] = $super_user['8.3'] = 'postgres';
-
-/* Associative array with the super user passwords for each configured server in your conf/config.inc.php :
- * $superpass = array(
- * the 'desc' part of the server in your conf/config.inc.php => the super user password,
- * ...
- * )
- */
-$super_pass['7.3'] = $super_pass['7.4'] = $super_pass['8.0'] =
-$super_pass['8.1'] = $super_pass['8.2'] = $super_pass['8.3'] = 'pgpass';
-
-/* name and pass of the admin user to create for tests*/
+
+$test_servers = array('PostgreSQL','Test Server');
+
+/* Associative array with the super user names for each configured server in
+ your conf/config.inc.php :
+ * $super_user = array(
+ * the 'desc' part of the server in your conf/config.inc.php => the
+ super user name,
+ * ...
+ * )
+ These profiles are only used to create the admin test role (or user) on
+ each server.
+*/
+
+$super_user= array(
+ 'PostgreSQL' => 'ppa_user',
+ 'Test Server' => 'ppa_user',
+);
+
+
+/* Associative array with the super user passwords for each configured server
+ in your conf/config.inc.php :
+ * $super_pass = array(
+ * the 'desc' part of the server in your conf/config.inc.php => the
+ super user password,
+ * ...
+ * )
+*/
+$super_pass= array(
+ 'PostgreSQL' => 'secret',
+ 'Test Server' => 'password',
+);
+
+
+// name and pass of the admin user to create for tests
$admin_user = 'admin_user';
$admin_user_pass = 'super';
-/* name and pass of the user to create for tests*/
+// name and pass of the user to create for tests
$user = 'ppa_tests_user';
$user_pass = 'ppa_tests_user_pass';
-/* name of the database to create for tests */
+// name of the database to create for tests
$testdb = 'ppatests_db';
-?>
+
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.