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