xref: /PHP-8.4/ext/pdo_odbc/tests/pdoodbc_001.phpt (revision 6ec42201)
1--TEST--
2PDO_odbc subclass basic
3--EXTENSIONS--
4pdo_odbc
5--SKIPIF--
6<?php
7require 'ext/pdo/tests/pdo_test.inc';
8PDOTest::skip();
9?>
10--FILE--
11<?php
12
13require 'ext/pdo/tests/pdo_test.inc';
14$config = PDOTest::get_config(__DIR__ . "/common.phpt");
15$db = new Pdo\Odbc($config['ENV']['PDOTEST_DSN'], $config['ENV']['PDOTEST_USER'], $config['ENV']['PDOTEST_PASS']);
16
17$db->query("CREATE TABLE pdoodbc_001 (id INT, name TEXT)");
18$db->query("INSERT INTO pdoodbc_001 VALUES (NULL, 'PHP'), (NULL, 'PHP6')");
19
20foreach ($db->query('SELECT name FROM pdoodbc_001') as $row) {
21    var_dump($row);
22}
23
24echo "Fin.";
25?>
26--CLEAN--
27<?php
28require 'ext/pdo/tests/pdo_test.inc';
29$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
30$db->exec("DROP TABLE IF EXISTS pdoodbc_001");
31?>
32--EXPECT--
33array(2) {
34  ["name"]=>
35  string(3) "PHP"
36  [0]=>
37  string(3) "PHP"
38}
39array(2) {
40  ["name"]=>
41  string(4) "PHP6"
42  [0]=>
43  string(4) "PHP6"
44}
45Fin.
46