diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /ext/pdo/tests/pdo_024.phpt | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'ext/pdo/tests/pdo_024.phpt')
-rw-r--r-- | ext/pdo/tests/pdo_024.phpt | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/ext/pdo/tests/pdo_024.phpt b/ext/pdo/tests/pdo_024.phpt new file mode 100644 index 0000000..1b4f841 --- /dev/null +++ b/ext/pdo/tests/pdo_024.phpt @@ -0,0 +1,35 @@ +--TEST-- +PDO Common: assert that bindParam does not modify parameter +--SKIPIF-- +<?php # vim:ft=php +if (!extension_loaded('pdo')) die('skip'); +$dir = getenv('REDIR_TEST_DIR'); +if (false == $dir) die('skip no driver'); +require_once $dir . 'pdo_test.inc'; +PDOTest::skip(); +?> +--FILE-- +<?php +if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); +require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; +$db = PDOTest::factory(); + +$db->exec('create table test (id int, name varchar(10))'); + +$stmt = $db->prepare('insert into test (id, name) values(0, :name)'); +$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('select name from test where id=0')->fetchColumn()); + +?> +--EXPECT-- +bind: success +bool(true) +NULL |