ssb Sat Jan 13 16:30:02 2001 EDT Added files: /php4/pear/DB/tests/ibase .cvsignore 001.phpt 002.phpt 003.phpt 004.phpt 006.phpt 010.phpt connect.inc mktable.inc skipif.inc Log: * defined some interbase tests, unable to run them yet Index: php4/pear/DB/tests/ibase/.cvsignore +++ php4/pear/DB/tests/ibase/.cvsignore *.exp *.out *.php phpt.* Index: php4/pear/DB/tests/ibase/001.phpt +++ php4/pear/DB/tests/ibase/001.phpt --TEST-- DB_ibase::connect test --SKIPIF-- <?php require "skipif.inc"; ?> --FILE-- <?php require "connect.inc"; if (is_object($dbh)) { print "\$dbh is an object\n"; } if (is_resource($dbh->connection)) { print "\$dbh is connected\n"; } ?> --EXPECT-- $dbh is an object $dbh is connected Index: php4/pear/DB/tests/ibase/002.phpt +++ php4/pear/DB/tests/ibase/002.phpt --TEST-- DB_ibase fetch modes test --SKIPIF-- <?php include("skipif.inc"); ?> --FILE-- <?php require_once "DB.php"; include("mktable.inc"); include("../fetchmodes.inc"); ?> --EXPECT-- testing fetchrow default default 0 1 2 3 testing fetchinto default default 0 1 2 3 testing fetchrow ordered default 0 1 2 3 testing fetchrow assoc default a b c d testing fetchrow ordered default with assoc specified a b c d testing fetchrow assoc default with ordered specified 0 1 2 3 testing fetchinto ordered default 0 1 2 3 testing fetchinto assoc default a b c d testing fetchinto ordered default with assoc specified a b c d testing fetchinto assoc default with ordered specified 0 1 2 3 Index: php4/pear/DB/tests/ibase/003.phpt +++ php4/pear/DB/tests/ibase/003.phpt --TEST-- DB_ibase::simpleQuery test --SKIPIF-- <?php include("skipif.inc"); ?> --FILE-- <?php require_once "DB.php"; include("mktable.inc"); include("../simplequery.inc"); ?> --EXPECT-- resource Index: php4/pear/DB/tests/ibase/004.phpt +++ php4/pear/DB/tests/ibase/004.phpt --TEST-- DB_ibase::numCols test --SKIPIF-- <?php include("skipif.inc"); ?> --FILE-- <?php require_once "DB.php"; include("mktable.inc"); include("../numcols.inc"); ?> --EXPECT-- 1 2 3 4 Index: php4/pear/DB/tests/ibase/006.phpt +++ php4/pear/DB/tests/ibase/006.phpt --TEST-- DB_ibase::prepare/execute test --SKIPIF-- <?php include("skipif.inc"); ?> --FILE-- <?php require_once "DB.php"; include("mktable.inc"); include("../prepexe.inc"); ?> --EXPECT-- sth1,sth2,sth3 created sth1 executed sth2 executed sth3 executed results: 72 - - - 72 - bing - - 72 - gazonk - opaque placeholder test - Index: php4/pear/DB/tests/ibase/010.phpt +++ php4/pear/DB/tests/ibase/010.phpt --TEST-- DB_ibase error mapping --SKIPIF-- <?php require "skipif.inc"; ?> --FILE-- <?php require "connect.inc"; require "mktable.inc"; require "../errors.inc"; ?> --EXPECT-- Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_ALREADY_EXISTS DB Error: already exists Trying to provoke DB_ERROR_NOSUCHTABLE DB Error: no such table Trying to provoke DB_ERROR_CONSTRAINT Trying to provoke DB_ERROR_DIVZERO DB Error: division by zero Trying to provoke DB_ERROR_INVALID_NUMBER DB Error: invalid number Trying to provoke DB_ERROR_NOSUCHFIELD DB Error: no such field Trying to provoke DB_ERROR_SYNTAX DB Error: syntax error Index: php4/pear/DB/tests/ibase/connect.inc +++ php4/pear/DB/tests/ibase/connect.inc <?php require_once "DB.php"; $dbh = DB::connect("ibase://localhost/test"); ?> Index: php4/pear/DB/tests/ibase/mktable.inc +++ php4/pear/DB/tests/ibase/mktable.inc <?php require "connect.inc"; $dbh->setErrorHandling(PEAR_ERROR_RETURN); $dbh->query("DROP TABLE phptest"); $dbh->setErrorHandling(PEAR_ERROR_TRIGGER); $dbh->query("CREATE TABLE phptest (a INTEGER, b VARCHAR(40), c TEXT, d DATE)"); $dbh->query("INSERT INTO phptest VALUES(42, 'bing', 'This is a test', '1999-11-21')"); $dbh->setErrorHandling(PEAR_ERROR_RETURN); ?> Index: php4/pear/DB/tests/ibase/skipif.inc +++ php4/pear/DB/tests/ibase/skipif.inc <?php // This script prints "skip" unless: // * the ibase extension is built-in or loadable, AND // * there is a database called "test" accessible // with no username/password, AND if (!extension_loaded("interbase")) { $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so"; @dl("interbase$dlext"); } if (!extension_loaded("interbase")) { die("skip\n"); } $conn = @ibase_connect("test"); if (!is_resource($conn)) { die("skip\n"); } ?> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]