home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Web Server / PHP.EXE / pear / DB / tests / db_factory.phpt < prev    next >
Encoding:
Text File  |  2000-12-15  |  1.1 KB  |  47 lines

  1. --TEST--
  2. DB::factory test
  3. --SKIPIF--
  4. <?php if (!include("DB.php")) print "skip"; ?>
  5. --FILE--
  6. <?php // -*- C++ -*-
  7.  
  8. // Test for: DB.php
  9. // Parts tested: DB_Error, DB_Warning
  10.  
  11. require_once "DB.php";
  12.  
  13. $backends = array(
  14.     "ibase",
  15.     "msql",
  16.     "mssql",
  17.     "mysql",
  18.     "oci8",
  19.     "odbc",
  20.     "pgsql",
  21.     "sybase"
  22. );
  23.  
  24. reset($backends);
  25. while (list($i, $name) = each($backends)) {
  26.     print "testing $name: ";
  27.     $obj = DB::factory($name);
  28.     if (DB::isError($obj)) {
  29.     print "error: ".$obj->getMessage()."\n";
  30.     } else {
  31.     print "object: ".$obj->toString()."\n";
  32.     }
  33. }
  34.  
  35. ?>
  36. --GET--
  37. --POST--
  38. --EXPECT--
  39. testing ibase: object: db_ibase: (phptype=ibase, dbsyntax=ibase)
  40. testing msql: object: db_msql: (phptype=msql, dbsyntax=msql)
  41. testing mssql: object: db_mssql: (phptype=mssql, dbsyntax=mssql)
  42. testing mysql: object: db_mysql: (phptype=mysql, dbsyntax=mysql)
  43. testing oci8: object: db_oci8: (phptype=oci8, dbsyntax=oci8)
  44. testing odbc: object: db_odbc: (phptype=odbc, dbsyntax=sql92)
  45. testing pgsql: object: db_pgsql: (phptype=pgsql, dbsyntax=pgsql)
  46. testing sybase: object: db_sybase: (phptype=sybase, dbsyntax=sybase)
  47.