-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ResultSet: parameters are passed to statement via bindValue with corr…
…ect type [Closes #63]
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Nette\Database\ResultSet parameters | ||
* @dataProvider? databases.ini mysql | ||
*/ | ||
|
||
use Tester\Assert, | ||
Nette\Utils\DateTime; | ||
|
||
require __DIR__ . '/connect.inc.php'; // create $connection | ||
|
||
$res = $connection->fetch('SELECT ? AS c1, ? AS c2, ? AS c3, ? as c4', fopen(__FILE__, 'r'), TRUE, NULL, 123); | ||
|
||
Assert::same( | ||
array('c1' => file_get_contents(__FILE__), 'c2' => 1, 'c3' => NULL, 'c4' => 123), | ||
(array) $res | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
/** | ||
* Test: Nette\Database\ResultSet parameters | ||
* @dataProvider? databases.ini postgresql | ||
*/ | ||
|
||
use Tester\Assert, | ||
Nette\Utils\DateTime; | ||
|
||
require __DIR__ . '/connect.inc.php'; // create $connection | ||
|
||
$res = $connection->fetch('SELECT ? AS c1, ? AS c2, ? AS c3', TRUE, NULL, 123); | ||
|
||
Assert::same( | ||
array('c1' => TRUE, 'c2' => NULL, 'c3' => 123), | ||
(array) $res | ||
); |