summaryrefslogtreecommitdiff
path: root/ext/interbase
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2008-11-11 18:42:00 +0000
committerFelipe Pena <felipe@php.net>2008-11-11 18:42:00 +0000
commitcac8a72989a9951b861b52552bfc1de97be9a6df (patch)
tree3438261615fd779cd2e9c283ca426fb58621255c /ext/interbase
parentd7a80059bbb7e633063984aaa673180c88b83645 (diff)
downloadphp-git-cac8a72989a9951b861b52552bfc1de97be9a6df.tar.gz
- Fixes and new tests
Diffstat (limited to 'ext/interbase')
-rw-r--r--ext/interbase/tests/bug45373.phpt2
-rw-r--r--ext/interbase/tests/ibase_close_001.phpt25
-rw-r--r--ext/interbase/tests/ibase_drop_db_001.phpt31
-rw-r--r--ext/interbase/tests/ibase_errmsg_001.phpt2
-rw-r--r--ext/interbase/tests/ibase_num_fields_001.phpt25
-rw-r--r--ext/interbase/tests/ibase_param_info_001.phpt2
-rw-r--r--ext/interbase/tests/ibase_rollback_001.phpt41
7 files changed, 127 insertions, 1 deletions
diff --git a/ext/interbase/tests/bug45373.phpt b/ext/interbase/tests/bug45373.phpt
index bbaccd1289..8ec71df154 100644
--- a/ext/interbase/tests/bug45373.phpt
+++ b/ext/interbase/tests/bug45373.phpt
@@ -45,3 +45,5 @@ Warning: ibase_execute(): Statement expects 2 arguments, 1 given in %sbug45373.p
Warning: ibase_fetch_assoc(): supplied argument is not a valid Firebird/InterBase result resource in %sbug45373.php on line %d
bool(false)
+
+Warning: Unknown: invalid statement handle in Unknown on line 0
diff --git a/ext/interbase/tests/ibase_close_001.phpt b/ext/interbase/tests/ibase_close_001.phpt
new file mode 100644
index 0000000000..25412d4849
--- /dev/null
+++ b/ext/interbase/tests/ibase_close_001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ibase_close(): Basic test
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php
+
+require("interbase.inc");
+
+$x = ibase_connect($test_base);
+var_dump(ibase_close($x));
+var_dump(ibase_close($x));
+var_dump(ibase_close());
+var_dump(ibase_close('foo'));
+
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+
+Warning: ibase_close(): %d is not a valid Firebird/InterBase link resource in %s on line %d
+bool(false)
+
+Warning: ibase_close(): %d is not a valid Firebird/InterBase link resource in %s on line %d
+bool(false)
diff --git a/ext/interbase/tests/ibase_drop_db_001.phpt b/ext/interbase/tests/ibase_drop_db_001.phpt
new file mode 100644
index 0000000000..b5cabced53
--- /dev/null
+++ b/ext/interbase/tests/ibase_drop_db_001.phpt
@@ -0,0 +1,31 @@
+--TEST--
+ibase_drop_db(): Basic test
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php
+
+require("interbase.inc");
+
+unlink($file = tempnam('/tmp',"php_ibase_test"));
+
+
+$db = ibase_query(IBASE_CREATE,
+ sprintf("CREATE SCHEMA '%s' USER '%s' PASSWORD '%s' DEFAULT CHARACTER SET %s",$file,
+ $user, $password, ($charset = ini_get('ibase.default_charset')) ? $charset : 'NONE'));
+
+var_dump($db);
+var_dump(ibase_drop_db($db));
+var_dump(ibase_drop_db(1));
+var_dump(ibase_drop_db(NULL));
+
+?>
+--EXPECTF--
+resource(%d) of type (Firebird/InterBase link)
+bool(true)
+
+Warning: ibase_drop_db(): supplied resource is not a valid Firebird/InterBase link resource in %s on line %d
+bool(false)
+
+Warning: ibase_drop_db(): %d is not a valid Firebird/InterBase link resource in %s on line %d
+bool(false)
diff --git a/ext/interbase/tests/ibase_errmsg_001.phpt b/ext/interbase/tests/ibase_errmsg_001.phpt
index af17f5c991..8214b1c214 100644
--- a/ext/interbase/tests/ibase_errmsg_001.phpt
+++ b/ext/interbase/tests/ibase_errmsg_001.phpt
@@ -18,5 +18,5 @@ var_dump(ibase_errmsg());
?>
--EXPECTF--
Warning: ibase_query(): Dynamic SQL Error SQL error code = -104 Unexpected end of command %s on line %d
-string(%d) "Dynamic SQL Error SQL error code = -104 Unexpected end of command %s"
+string(%d) "Dynamic SQL Error SQL error code = -104 Unexpected end of command%s"
bool(false)
diff --git a/ext/interbase/tests/ibase_num_fields_001.phpt b/ext/interbase/tests/ibase_num_fields_001.phpt
new file mode 100644
index 0000000000..510b0f6f58
--- /dev/null
+++ b/ext/interbase/tests/ibase_num_fields_001.phpt
@@ -0,0 +1,25 @@
+--TEST--
+ibase_num_fields(): Basic test
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php
+
+require("interbase.inc");
+
+$x = ibase_connect($test_base);
+
+var_dump(ibase_num_fields(ibase_query('SELECT * FROM test1')));
+
+var_dump(ibase_num_fields(1));
+var_dump(ibase_num_fields());
+
+?>
+--EXPECTF--
+int(2)
+
+Warning: ibase_num_fields(): supplied argument is not a valid Firebird/InterBase result resource in %s on line %d
+bool(false)
+
+Warning: Wrong parameter count for ibase_num_fields() in %s on line %d
+NULL
diff --git a/ext/interbase/tests/ibase_param_info_001.phpt b/ext/interbase/tests/ibase_param_info_001.phpt
index c8054f683b..3dd92ba7a2 100644
--- a/ext/interbase/tests/ibase_param_info_001.phpt
+++ b/ext/interbase/tests/ibase_param_info_001.phpt
@@ -51,3 +51,5 @@ bool(false)
Warning: Wrong parameter count for ibase_param_info() in %s on line %d
NULL
+
+Warning: Unknown: invalid statement handle in Unknown on line 0
diff --git a/ext/interbase/tests/ibase_rollback_001.phpt b/ext/interbase/tests/ibase_rollback_001.phpt
new file mode 100644
index 0000000000..3cde5e9d46
--- /dev/null
+++ b/ext/interbase/tests/ibase_rollback_001.phpt
@@ -0,0 +1,41 @@
+--TEST--
+ibase_rollback(): Basic test
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php
+
+require("interbase.inc");
+
+$x = ibase_connect($test_base);
+
+ibase_query('INSERT INTO test1 VALUES (100, 2)');
+ibase_query('INSERT INTO test1 VALUES (100, 2)');
+ibase_query('INSERT INTO test1 VALUES (100, 2)');
+
+$rs = ibase_query('SELECT COUNT(*) FROM test1 WHERE i = 100');
+var_dump(ibase_fetch_row($rs));
+
+var_dump(ibase_rollback($x));
+
+$rs = ibase_query('SELECT COUNT(*) FROM test1 WHERE i = 100');
+var_dump(ibase_fetch_row($rs));
+
+var_dump(ibase_rollback($x));
+var_dump(ibase_rollback());
+
+?>
+--EXPECTF--
+array(1) {
+ [0]=>
+ int(3)
+}
+bool(true)
+array(1) {
+ [0]=>
+ int(0)
+}
+bool(true)
+
+Warning: ibase_rollback(): invalid transaction handle (expecting explicit transaction start) in %s on line %d
+bool(false)