Annotation of embedaddon/php/ext/pdo/tests/bug_36798.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: PDO Common: Bug #36798 (Error parsing named parameters with queries containing high-ascii chars)
                      3: --SKIPIF--
                      4: <?php  
                      5: if (!extension_loaded('pdo')) die('skip');
                      6: $dir = getenv('REDIR_TEST_DIR');
                      7: if (false == $dir) die('skip no driver');
                      8: require_once $dir . 'pdo_test.inc';
                      9: PDOTest::skip();
                     10: 
                     11: if (!strncasecmp(getenv('PDOTEST_DSN'), 'oci', strlen('oci'))){
                     12:     if (!strpos(strtolower(getenv('PDOTEST_DSN')), 'charset=we8mswin1252')) die('skip expected output valid for Oracle with WE8MSWIN1252 character set');
                     13: 
                     14: }
                     15: 
                     16: ?>
                     17: --FILE--
                     18: <?php
                     19: 
                     20: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
                     21: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
                     22: $db = PDOTest::factory();
                     23: 
                     24: @$db->exec("SET NAMES 'LATIN1'"); // needed for PostgreSQL
                     25: $db->exec("CREATE TABLE test (id INTEGER)");
                     26: $db->exec("INSERT INTO test (id) VALUES (1)");
                     27: 
                     28: $stmt = $db->prepare("SELECT 'Ã' as test FROM test WHERE id = :id");
                     29: $stmt->execute(array(":id" => 1));
                     30: 
                     31: $row = $stmt->fetch(PDO::FETCH_NUM);
                     32: var_dump( $row );
                     33: 
                     34: ?>
                     35: --EXPECT--     
                     36: array(1) {
                     37:   [0]=>
                     38:   string(1) "Ã"
                     39: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>