Commit 72aef206 authored by Steve Müller's avatar Steve Müller

add test for explicit positional parameter keys

parent 7175964c
...@@ -47,6 +47,7 @@ AND baz = "\"quote\" me on it? \\" OR baz = ? ...@@ -47,6 +47,7 @@ AND baz = "\"quote\" me on it? \\" OR baz = ?
SQLDATA SQLDATA
, true, array(58, 104) , true, array(58, 104)
), ),
array('SELECT * FROM foo WHERE foo = ? AND bar = ?', true, array(1 => 42, 0 => 30)), // explicit keys
// named // named
array('SELECT :foo FROM :bar', false, array(7 => 'foo', 17 => 'bar')), array('SELECT :foo FROM :bar', false, array(7 => 'foo', 17 => 'bar')),
...@@ -138,6 +139,15 @@ SQLDATA ...@@ -138,6 +139,15 @@ SQLDATA
array(), array(),
array() array()
), ),
// Positional: explicit keys for params and types
array(
"SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?",
array(1 => 'bar', 2 => 'baz', 0 => 1),
array(2 => \PDO::PARAM_STR, 1 => \PDO::PARAM_STR),
'SELECT * FROM Foo WHERE foo = ? AND bar = ? AND baz = ?',
array(1 => 'bar', 0 => 1, 2 => 'baz'),
array(1 => \PDO::PARAM_STR, 2 => \PDO::PARAM_STR)
),
// Named parameters : Very simple with param int // Named parameters : Very simple with param int
array( array(
"SELECT * FROM Foo WHERE foo = :foo", "SELECT * FROM Foo WHERE foo = :foo",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment