ssb             Sun Feb 18 16:49:08 2001 EDT

  Added files:                 
    /php4/pear/DB/tests/oci8    001.phpt 002.phpt 003.phpt 004.phpt 
                                005.phpt 006.phpt 007.phpt 008.phpt 
                                009.phpt 010.phpt connect.inc mktable.inc 
                                skipif.inc 

  Modified files:              
    /php4/pear/DB/tests numrows.inc 
  Log:
  * added oci8 tests (haven't run them myself yet)
  
  
Index: php4/pear/DB/tests/numrows.inc
diff -u php4/pear/DB/tests/numrows.inc:1.3 php4/pear/DB/tests/numrows.inc:1.4
--- php4/pear/DB/tests/numrows.inc:1.3  Thu Dec 14 18:36:18 2000
+++ php4/pear/DB/tests/numrows.inc      Sun Feb 18 16:49:07 2001
@@ -9,7 +9,11 @@
     }
 }
 
-$dbh->setErrorHandling(PEAR_ERROR_DIE);
+if (isset($test_error_mode)) {
+    $dbh->setErrorHandling($test_error_mode);
+} else {
+    $dbh->setErrorHandling(PEAR_ERROR_DIE);
+}
 $sth = $dbh->query("SELECT a FROM phptest");
 printf("%d\n", $sth->numRows());
 for ($i = 0; $i < 5; $i++) {

Index: php4/pear/DB/tests/oci8/001.phpt
+++ php4/pear/DB/tests/oci8/001.phpt
--TEST--
DB_oci8::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/oci8/002.phpt
+++ php4/pear/DB/tests/oci8/002.phpt
--TEST--
DB_oci8 fetch test
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require_once "DB.php";
include("mktable.inc");
include("../fetchrow.inc");
include("../fetchmodes.inc");
?>
--EXPECT--
testing fetchrow:
row 1: 42, bing, This is a test, 11-21-1999
row 2: 1, one, One, 02-16-2001
row 3: 2, two, Two, 02-15-2001
row 4: 3, three, Three, 02-14-2001
row 5: NULL
testing fetchmodes: fetchrow default default
0 1 2 3
testing fetchmodes: fetchinto default default
0 1 2 3
testing fetchmodes: fetchrow ordered default
0 1 2 3
testing fetchmodes: fetchrow assoc default
a b c d
testing fetchmodes: fetchrow ordered default with assoc specified
a b c d
testing fetchmodes: fetchrow assoc default with ordered specified
0 1 2 3
testing fetchmodes: fetchinto ordered default
0 1 2 3
testing fetchmodes: fetchinto assoc default
a b c d
testing fetchmodes: fetchinto ordered default with assoc specified
a b c d
testing fetchmodes: fetchinto assoc default with ordered specified
0 1 2 3

Index: php4/pear/DB/tests/oci8/003.phpt
+++ php4/pear/DB/tests/oci8/003.phpt
--TEST--
DB_oci8::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/oci8/004.phpt
+++ php4/pear/DB/tests/oci8/004.phpt
--TEST--
DB_oci8::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/oci8/005.phpt
+++ php4/pear/DB/tests/oci8/005.phpt
--TEST--
DB_oci8 sequences
--SKIPIF--
<?php require "skipif.inc"; ?>
--FILE--
<?php
require "connect.inc";
require "../sequences.inc";
?>
--EXPECT--
DB Error: no such table
a=1
b=2

Index: php4/pear/DB/tests/oci8/006.phpt
+++ php4/pear/DB/tests/oci8/006.phpt
--TEST--
DB_oci8::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/oci8/007.phpt
+++ php4/pear/DB/tests/oci8/007.phpt
--TEST--
DB_oci8::errorNative test
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require_once "DB.php";
include("mktable.inc");
$dbh->query("syntax error please");
print $dbh->errorNative() . "\n";
?>
--EXPECT--
XXX fill me in

Index: php4/pear/DB/tests/oci8/008.phpt
+++ php4/pear/DB/tests/oci8/008.phpt
--TEST--
DB_oci8::affectedRows test
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
require_once "DB.php";
include("mktable.inc");
$dbh->query("INSERT INTO phptest (a,b) VALUES(1, 'test')");
$dbh->query("INSERT INTO phptest (a,b) VALUES(2, 'test')");
printf("%d after insert\n", $dbh->affectedRows());
$dbh->query("SELECT * FROM phptest");
printf("%d after select\n", $dbh->affectedRows());
$dbh->query("DELETE FROM phptest WHERE b = 'test'");
printf("%d after delete\n", $dbh->affectedRows());
$dbh->query("INSERT INTO phptest (a,b) VALUES(1, 'test')");
$dbh->query("INSERT INTO phptest (a,b) VALUES(2, 'test')");
$dbh->query("DELETE FROM phptest");
printf("%d after delete all\n", $dbh->affectedRows());
?>
--EXPECT--
1 after insert
0 after select
2 after delete
3 after delete all

Index: php4/pear/DB/tests/oci8/009.phpt
+++ php4/pear/DB/tests/oci8/009.phpt
--TEST--
DB_oci8::numRows test
--SKIPIF--
<?php require "skipif.inc"; ?>
--FILE--
<?php
require "connect.inc";
require "mktable.inc";
$test_error_mode = PEAR_ERROR_PRINT;
include "../numrows.inc";
?>
--EXPECT--
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: DB backend not capable
DB Error: unknown error

Index: php4/pear/DB/tests/oci8/010.phpt
+++ php4/pear/DB/tests/oci8/010.phpt
--TEST--
DB_oci8 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/oci8/connect.inc
+++ php4/pear/DB/tests/oci8/connect.inc
<?php
require_once "DB.php";
$dbh = DB::connect("oci8://test:test@test");
?>

Index: php4/pear/DB/tests/oci8/mktable.inc
+++ php4/pear/DB/tests/oci8/mktable.inc
<?php

require_once "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 VARCHAR2(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/oci8/skipif.inc
+++ php4/pear/DB/tests/oci8/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("oci8")) {
  $dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
  @dl("oci8$dlext");
}
if (!extension_loaded("oci8")) {
    die("skip\n");
}
$conn = @OCILogon("test", "test", "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]

Reply via email to