1--TEST--
2PDO_OCI: Attribute: Server version and info
3--EXTENSIONS--
4pdo
5pdo_oci
6--SKIPIF--
7<?php
8require(__DIR__.'/../../pdo/tests/pdo_test.inc');
9PDOTest::skip();
10?>
11--FILE--
12<?php
13
14require(__DIR__ . '/../../pdo/tests/pdo_test.inc');
15
16$dbh = PDOTest::factory();
17
18echo "Test 1\n";
19echo "ATTR_SERVER_VERSION: ";
20var_dump($dbh->getAttribute(PDO::ATTR_SERVER_VERSION));
21
22echo "Test 2\n";
23echo "ATTR_SERVER_INFO\n";
24$si = $dbh->getAttribute(PDO::ATTR_SERVER_INFO);
25$pos = strpos($si, "Oracle");
26if ($pos === 0) {
27    echo "Found 'Oracle' at position $pos as expected\n";
28} else {
29    echo "Unexpected result.  Server info was:\n";
30    var_dump($si);
31}
32
33echo "Done\n";
34
35?>
36--EXPECTF--
37Test 1
38ATTR_SERVER_VERSION: string(%d) "%d.%d.%d.%d.%d"
39Test 2
40ATTR_SERVER_INFO
41Found 'Oracle' at position 0 as expected
42Done
43