Annotation of embedaddon/php/ext/pdo_oci/tests/pdo_oci_attr_server.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PDO_OCI: Attribute: Server version and info
3: --SKIPIF--
4: <?php
5: if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
6: require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc');
7: PDOTest::skip();
8: ?>
9: --FILE--
10: <?php
11:
12: require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
13:
14: $dbh = PDOTest::factory();
15:
16: echo "Test 1\n";
17: echo "ATTR_SERVER_VERSION: ";
18: var_dump($dbh->getAttribute(PDO::ATTR_SERVER_VERSION));
19:
20: echo "Test 2\n";
21: echo "ATTR_SERVER_INFO\n";
22: $si = $dbh->getAttribute(PDO::ATTR_SERVER_INFO);
23: $pos = strpos($si, "Oracle");
24: if ($pos === 0) {
25: echo "Found 'Oracle' at position $pos as expected\n";
26: } else {
27: echo "Unexpected result. Server info was:\n";
28: var_dump($si);
29: }
30:
31: echo "Done\n";
32:
33: ?>
34: --EXPECTF--
35: Test 1
36: ATTR_SERVER_VERSION: string(%d) "%d.%d.%d.%d.%d"
37: Test 2
38: ATTR_SERVER_INFO
39: Found 'Oracle' at position 0 as expected
40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>