summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-24 12:31:37 (GMT)
committerMarcus Boerger <helly@php.net>2005-03-24 12:31:37 (GMT)
commit2906d6570cd816f2edfd949e280c162f2f1e033f (patch)
tree67ae0aad11eaf34528693aa6f5d9af9ba879229e /ext
parent0a65a3d50547b7c3948ccc34199f8b3e181e1a63 (diff)
downloadphp-2906d6570cd816f2edfd949e280c162f2f1e033f.tar.gz
- Add new test
Diffstat (limited to 'ext')
-rwxr-xr-xext/pdo/tests/pdo_024.inc21
-rwxr-xr-xext/pdo_mysql/tests/pdo_024.phpt21
-rwxr-xr-xext/pdo_pgsql/tests/pdo_024.phpt21
-rwxr-xr-xext/pdo_sqlite/tests/pdo_024.phpt21
4 files changed, 84 insertions, 0 deletions
diff --git a/ext/pdo/tests/pdo_024.inc b/ext/pdo/tests/pdo_024.inc
new file mode 100755
index 0000000..60bb30a
--- /dev/null
+++ b/ext/pdo/tests/pdo_024.inc
@@ -0,0 +1,21 @@
+<?php # vim:ft=php
+
+require_once('pdo.inc');
+
+set_sql('create', 'create table test (id int, name varchar(10))');
+set_sql('insert', 'insert into test (id, name) values(0, :name)');
+set_sql('select', 'select name from test where id=0');
+
+$DB->query($SQL['create']);
+$stmt = $DB->prepare($SQL['insert']);
+$name = NULL;
+$before_bind = $name;
+$stmt->bindParam(':name', $name);
+if ($name !== $before_bind) {
+ echo "bind: fail\n";
+} else {
+ echo "bind: success\n";
+}
+var_dump($stmt->execute());
+var_dump($DB->query($SQL['select'])->fetchSingle());
+?>
diff --git a/ext/pdo_mysql/tests/pdo_024.phpt b/ext/pdo_mysql/tests/pdo_024.phpt
new file mode 100755
index 0000000..bf14896
--- /dev/null
+++ b/ext/pdo_mysql/tests/pdo_024.phpt
@@ -0,0 +1,21 @@
+--TEST--
+PDO_MySQL: Bind does not convert NULL
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+require_once($PDO_TESTS . 'pdo_024.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+bind: success
+bool(true)
+NULL
+===DONE===
diff --git a/ext/pdo_pgsql/tests/pdo_024.phpt b/ext/pdo_pgsql/tests/pdo_024.phpt
new file mode 100755
index 0000000..634e0bc
--- /dev/null
+++ b/ext/pdo_pgsql/tests/pdo_024.phpt
@@ -0,0 +1,21 @@
+--TEST--
+PDO_PGSQL: Bind does not convert NULL
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+require_once($PDO_TESTS . 'pdo_024.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+bind: success
+bool(true)
+NULL
+===DONE===
diff --git a/ext/pdo_sqlite/tests/pdo_024.phpt b/ext/pdo_sqlite/tests/pdo_024.phpt
new file mode 100755
index 0000000..1553041
--- /dev/null
+++ b/ext/pdo_sqlite/tests/pdo_024.phpt
@@ -0,0 +1,21 @@
+--TEST--
+PDO_SQLite: Bind does not convert NULL
+--SKIPIF--
+<?php # vim:ft=php
+require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+require_once('connection.inc');
+require_once('prepare.inc');
+
+require_once($PDO_TESTS . 'pdo_024.inc');
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+bind: success
+bool(true)
+NULL
+===DONE===