Download src/php/php-src/ext/pdo/tests/pdo_007.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/pdo_007.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo/tests/pdo_007.phpt
-
curl -L -o pdo_007.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/pdo_007.phpt
1.38 kB
| --TEST-- | |
| PDO Common: PDO::FETCH_UNIQUE | |
| --EXTENSIONS-- | |
| pdo | |
| --SKIPIF-- | |
| $dir = getenv('REDIR_TEST_DIR'); | |
| if (false == $dir) die('skip no driver'); | |
| require_once $dir . 'pdo_test.inc'; | |
| PDOTest::skip(); | |
| --FILE-- | |
| if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.__DIR__ . '/../../pdo/tests/'); | |
| require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | |
| $db = PDOTest::factory(); | |
| $db->exec('CREATE TABLE test007(id CHAR(1) NOT NULL PRIMARY KEY, val VARCHAR(10))'); | |
| $db->exec("INSERT INTO test007 VALUES('A', 'A')"); | |
| $db->exec("INSERT INTO test007 VALUES('B', 'A')"); | |
| $db->exec("INSERT INTO test007 VALUES('C', 'C')"); | |
| $stmt = $db->prepare('SELECT id, val from test007'); | |
| $stmt->execute(); | |
| var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_UNIQUE)); | |
| $stmt->execute(); | |
| var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_UNIQUE)); | |
| --CLEAN-- | |
| require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | |
| $db = PDOTest::factory(); | |
| PDOTest::dropTableIfExists($db, "test007"); | |
| --EXPECT-- | |
| array(3) { | |
| ["A"]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "A" | |
| } | |
| ["B"]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "A" | |
| } | |
| ["C"]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "C" | |
| } | |
| } | |
| array(3) { | |
| ["A"]=> | |
| array(1) { | |
| ["val"]=> | |
| string(1) "A" | |
| } | |
| ["B"]=> | |
| array(1) { | |
| ["val"]=> | |
| string(1) "A" | |
| } | |
| ["C"]=> | |
| array(1) { | |
| ["val"]=> | |
| string(1) "C" | |
| } | |
| } | |