Download src/php/php-src/ext/pdo/tests/pdo_006.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/pdo_006.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo/tests/pdo_006.phpt
-
curl -L -o pdo_006.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo/tests/pdo_006.phpt
1.52 kB
| --TEST-- | |
| PDO Common: PDO::FETCH_GROUP | |
| --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 test006(id int NOT NULL PRIMARY KEY, val VARCHAR(10))'); | |
| $db->exec("INSERT INTO test006 VALUES(1, 'A')"); | |
| $db->exec("INSERT INTO test006 VALUES(2, 'A')"); | |
| $db->exec("INSERT INTO test006 VALUES(3, 'C')"); | |
| $stmt = $db->prepare('SELECT val, id from test006'); | |
| $stmt->execute(); | |
| var_dump($stmt->fetchAll(PDO::FETCH_NUM|PDO::FETCH_GROUP)); | |
| $stmt->execute(); | |
| var_dump($stmt->fetchAll(PDO::FETCH_ASSOC|PDO::FETCH_GROUP)); | |
| --CLEAN-- | |
| require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc'; | |
| $db = PDOTest::factory(); | |
| PDOTest::dropTableIfExists($db, "test006"); | |
| --EXPECT-- | |
| array(2) { | |
| ["A"]=> | |
| array(2) { | |
| [0]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "1" | |
| } | |
| [1]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "2" | |
| } | |
| } | |
| ["C"]=> | |
| array(1) { | |
| [0]=> | |
| array(1) { | |
| [0]=> | |
| string(1) "3" | |
| } | |
| } | |
| } | |
| array(2) { | |
| ["A"]=> | |
| array(2) { | |
| [0]=> | |
| array(1) { | |
| ["id"]=> | |
| string(1) "1" | |
| } | |
| [1]=> | |
| array(1) { | |
| ["id"]=> | |
| string(1) "2" | |
| } | |
| } | |
| ["C"]=> | |
| array(1) { | |
| [0]=> | |
| array(1) { | |
| ["id"]=> | |
| string(1) "3" | |
| } | |
| } | |
| } | |