summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamien Regad <dregad@mantisbt.org>2014-04-15 22:50:36 +0200
committerDamien Regad <dregad@mantisbt.org>2014-04-15 22:54:55 +0200
commit2d1e3bbe03d0539d644ebc92256d4c985829817b (patch)
tree0d01ece2da62b90e823516b3a57ee4e6abc8f04e /tests
parent30c21280a48680c079f825af6583793928d65cf5 (diff)
downloadadodb-2d1e3bbe03d0539d644ebc92256d4c985829817b.tar.gz
adodb-2d1e3bbe03d0539d644ebc92256d4c985829817b.tar.bz2
adodb-2d1e3bbe03d0539d644ebc92256d4c985829817b.zip
Minor fixes and adjustments to test suite
- rely on default time zone instead of setting it to Asia/Kuala_Lumpur - improve error message for PostgreSQL testing - cosmetic changes
Diffstat (limited to 'tests')
-rw-r--r--tests/test.php7
-rw-r--r--tests/testdatabases.inc.php21
2 files changed, 20 insertions, 8 deletions
diff --git a/tests/test.php b/tests/test.php
index 3fa8438c..3ecfd1cf 100644
--- a/tests/test.php
+++ b/tests/test.php
@@ -125,11 +125,14 @@ FROM `nuke_stories` `t1`, `nuke_authors` `t2`, `nuke_stories_cat` `t3`, `nuke_to
$phpv = phpversion();
if (defined('ADODB_EXTENSION')) $ext = ' &nbsp; Extension '.ADODB_EXTENSION.' installed';
else $ext = '';
- print "<h3>ADODB Version: $ADODB_vers Host: <i>$db->host</i> &nbsp; Database: <i>$db->database</i> &nbsp; PHP: $phpv $ext</h3>";
+ print "<h3>ADODB Version: $ADODB_vers";
+ print "<p>Host: <i>$db->host</i>";
+ print "<br>Database: <i>$db->database</i>";
+ print "<br>PHP: <i>$phpv $ext</i></h3>";
flush();
- if (function_exists('date_default_timezone_set')) date_default_timezone_set('Asia/Kuala_Lumpur');
+ print "Current timezone: " . date_default_timezone_get() . "<p>";
$arr = $db->ServerInfo();
print_r($arr);
diff --git a/tests/testdatabases.inc.php b/tests/testdatabases.inc.php
index dbf29ad7..e0a2e3c2 100644
--- a/tests/testdatabases.inc.php
+++ b/tests/testdatabases.inc.php
@@ -15,7 +15,7 @@ V5.19dev ??-???-2014 (c) 2000-2014 John Lim (jlim#natsoft.com). All rights res
<input type=checkbox name="testaccess" value=1 <?php echo !empty($testaccess) ? 'checked' : '' ?>> <b>Access</b><br>
<input type=checkbox name="testibase" value=1 <?php echo !empty($testibase) ? 'checked' : '' ?>> <b>Interbase</b><br>
<input type=checkbox name="testmssql" value=1 <?php echo !empty($testmssql) ? 'checked' : '' ?>> <b>MSSQL</b><br>
- <input type=checkbox name="testmysql" value=1 <?php echo !empty($testmysql) ? 'checked' : '' ?>> <b>MySQL</b><br>
+<input type=checkbox name="testmysql" value=1 <?php echo !empty($testmysql) ? 'checked' : '' ?>> <b>MySQL</b><br>
<input type=checkbox name="testmysqlodbc" value=1 <?php echo !empty($testmysqlodbc) ? 'checked' : '' ?>> <b>MySQL ODBC</b><br>
<input type=checkbox name="testmysqli" value=1 <?php echo !empty($testmysqli) ? 'checked' : '' ?>> <b>MySQLi</b>
<br>
@@ -78,15 +78,24 @@ function ADOLoadCode2($d)
}
flush();
+
+$pg_hostname = 'localhost';
+$pg_user = 'tester';
+$pg_password = 'test';
+$pg_database = 'northwind';
+$pg_errmsg = "ERROR: PostgreSQL requires a database called '$pg_database' "
+ . "on server '$pg_hostname', user '$pg_user', password '$pg_password'.<BR>";
+
if (!empty($testpostgres)) {
//ADOLoadCode("postgres");
$db = ADONewConnection('postgres');
print "<h1>Connecting $db->databaseType...</h1>";
- if ($db->Connect("localhost","tester","test","northwind")) {
+ if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
- }else
- print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
+ } else {
+ print $pg_errmsg . $db->ErrorMsg();
+ }
}
if (!empty($testpostgres9)) {
@@ -94,10 +103,10 @@ if (!empty($testpostgres9)) {
$db = ADONewConnection('postgres9');
print "<h1>Connecting $db->databaseType...</h1>";
- if ($db->Connect("localhost","tester","test","northwind")) {
+ if ($db->Connect($pg_hostname, $pg_user, $pg_password, $pg_database)) {
testdb($db,"create table ADOXYZ (id integer, firstname char(24), lastname varchar,created date)");
}else
- print "ERROR: PostgreSQL requires a database called test on server, user tester, password test.<BR>".$db->ErrorMsg();
+ print $pg_errmsg . $db->ErrorMsg();
}
if (!empty($testpgodbc)) {