diff options
author | Marcus Boerger <helly@php.net> | 2005-03-24 12:31:37 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2005-03-24 12:31:37 +0000 |
commit | 2906d6570cd816f2edfd949e280c162f2f1e033f (patch) | |
tree | 67ae0aad11eaf34528693aa6f5d9af9ba879229e | |
parent | 0a65a3d50547b7c3948ccc34199f8b3e181e1a63 (diff) | |
download | php-git-2906d6570cd816f2edfd949e280c162f2f1e033f.tar.gz |
- Add new test
-rwxr-xr-x | ext/pdo/tests/pdo_024.inc | 21 | ||||
-rwxr-xr-x | ext/pdo_mysql/tests/pdo_024.phpt | 21 | ||||
-rwxr-xr-x | ext/pdo_pgsql/tests/pdo_024.phpt | 21 | ||||
-rwxr-xr-x | ext/pdo_sqlite/tests/pdo_024.phpt | 21 |
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 0000000000..60bb30a77c --- /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 0000000000..bf14896fcc --- /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 0000000000..634e0bca4f --- /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 0000000000..15530419d7 --- /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=== |