cvs: pear /DB/tests errors.inc

From: Date: Thu, 19 Feb 2004 07:27:00 +0000
Subject: cvs: pear /DB/tests errors.inc
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-16661@lists.php.net to get a copy of this message
danielc Thu Feb 19 02:27:00 2004 EDT Modified files: /pear/DB/tests errors.inc Log: Legibility. http://cvs.php.net/diff.php/pear/DB/tests/errors.inc?r1=1.13&r2=1.14&ty=u Index: pear/DB/tests/errors.inc diff -u pear/DB/tests/errors.inc:1.13 pear/DB/tests/errors.inc:1.14 --- pear/DB/tests/errors.inc:1.13 Thu Feb 19 02:18:27 2004 +++ pear/DB/tests/errors.inc Thu Feb 19 02:27:00 2004 @@ -3,7 +3,7 @@ function errhandler($obj) { if ($obj->getCode() == DB_ERROR) { - print " unknown: ".$obj->getUserInfo()."\n"; + print ' unknown: ' . $obj->getUserInfo()."\n"; } else { $msg = $obj->getMessage(); print " $msg"; @@ -17,13 +17,13 @@ print "Trying to provoke DB_ERROR_NOSUCHTABLE\n"; -$dbh->query("SELECT * FROM tableThatsBogus"); +$dbh->query('SELECT * FROM tableThatsBogus'); print "Trying to provoke DB_ERROR_ALREADY_EXISTS for create table\n"; $dbh->query($test_mktable_query); print "Trying to provoke DB_ERROR_NOSUCHTABLE\n"; -$dbh->query("DROP TABLE tableThatsBogus"); +$dbh->query('DROP TABLE tableThatsBogus'); print "Trying to provoke DB_ERROR_CONSTRAINT for primary key insert duplicate\n"; @@ -54,17 +54,17 @@ print "Trying to provoke DB_ERROR_CONSTRAINT for foreign key\n"; $dbh->setErrorHandling(PEAR_ERROR_RETURN); -$dbh->query("DROP TABLE b"); -$dbh->query("DROP TABLE a"); -$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, "errhandler"); -$dbh->query("CREATE TABLE a (a INTEGER NOT NULL, PRIMARY KEY(a))"); -$dbh->query("CREATE TABLE b (b INTEGER REFERENCES a(a))"); -$dbh->query("INSERT INTO a VALUES(1)"); -$dbh->query("INSERT INTO b VALUES(2)"); +$dbh->query('DROP TABLE b'); +$dbh->query('DROP TABLE a'); +$dbh->setErrorHandling(PEAR_ERROR_CALLBACK, 'errhandler'); +$dbh->query('CREATE TABLE a (a INTEGER NOT NULL, PRIMARY KEY(a))'); +$dbh->query('CREATE TABLE b (b INTEGER REFERENCES a(a))'); +$dbh->query('INSERT INTO a values (1)'); +$dbh->query('INSERT INTO b values (2)'); switch ($dbh->phptype) { case 'mysql': case 'sqlite': - print " $dbh->phptype doesn't consider this an error\n"; + print " v-- $dbh->phptype doesn't consider this an error\n"; break; } @@ -81,30 +81,30 @@ $dbh->query("UPDATE peartestnull SET a = NULL WHERE a = 'one'"); switch ($dbh->phptype) { case 'mysql': - print " $dbh->phptype doesn't consider this an error\n"; + print " v-- $dbh->phptype doesn't consider this an error\n"; break; } print "Trying to provoke DB_ERROR_DIVZERO\n"; // Interbase detects the error on fetching -$dbh->getAll("SELECT 0/0 FROM phptest"); +$dbh->getAll('SELECT 0/0 FROM phptest'); switch ($dbh->phptype) { case 'mssql': case 'sybase': - print " PHP's $dbh->phptype extension doesn't report this error\n"; + print " v-- PHP's $dbh->phptype extension doesn't report this error\n"; break; case 'odbc': switch ($dbh->dbsyntax) { case 'access': - print " odbc($dbh->dbsyntax) doesn't report this error\n"; + print " v-- odbc($dbh->dbsyntax) doesn't report this error\n"; break; } break; case 'ifx': case 'mysql': case 'sqlite': - print " $dbh->phptype doesn't consider this an error\n"; + print " v-- $dbh->phptype doesn't consider this an error\n"; break; } @@ -113,15 +113,15 @@ switch ($dbh->phptype) { case 'mysql': case 'sqlite': - print " $dbh->phptype doesn't consider this an error\n"; + print " v-- $dbh->phptype doesn't consider this an error\n"; break; } print "Trying to provoke DB_ERROR_NOSUCHFIELD\n"; -$dbh->query("SELECT e FROM phptest"); +$dbh->query('SELECT e FROM phptest'); print "Trying to provoke DB_ERROR_SYNTAX\n"; -$dbh->query("CREATE"); +$dbh->query('CREATE'); $dbh->setErrorHandling(PEAR_ERROR_RETURN);

« previous php.pear.cvs (#16661) next »