Annotation of embedaddon/php/ext/pdo/tests/bug_39398.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: PDO Common: Bug #39398 (Booleans are not automatically translated to integers)
        !             3: --SKIPIF--
        !             4: <?php # vim:ft=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: --FILE--
        !            12: <?php
        !            13: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/'); 
        !            14: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
        !            15: 
        !            16: $db = PDOTest::factory();
        !            17: $db->exec("CREATE TABLE test (test INT)");
        !            18: 
        !            19: $boolean = 1;
        !            20: $stmt = $db->prepare('INSERT INTO test VALUES (:boolean)');
        !            21: $stmt->bindValue(':boolean', isset($boolean), PDO::PARAM_INT);
        !            22: $stmt->execute();
        !            23: 
        !            24: var_dump($db->query("SELECT * FROM test")->fetchAll(PDO::FETCH_ASSOC));
        !            25: ?>
        !            26: ===DONE===
        !            27: --EXPECT--
        !            28: array(1) {
        !            29:   [0]=>
        !            30:   array(1) {
        !            31:     ["test"]=>
        !            32:     string(1) "1"
        !            33:   }
        !            34: }
        !            35: ===DONE===

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