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