1--TEST-- 2PDO_OCI: Attribute: Server version and info 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded'); 6require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc'); 7PDOTest::skip(); 8?> 9--FILE-- 10<?php 11 12require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc'); 13 14$dbh = PDOTest::factory(); 15 16echo "Test 1\n"; 17echo "ATTR_SERVER_VERSION: "; 18var_dump($dbh->getAttribute(PDO::ATTR_SERVER_VERSION)); 19 20echo "Test 2\n"; 21echo "ATTR_SERVER_INFO\n"; 22$si = $dbh->getAttribute(PDO::ATTR_SERVER_INFO); 23$pos = strpos($si, "Oracle"); 24if ($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 31echo "Done\n"; 32 33?> 34--EXPECTF-- 35Test 1 36ATTR_SERVER_VERSION: string(%d) "%d.%d.%d.%d.%d" 37Test 2 38ATTR_SERVER_INFO 39Found 'Oracle' at position 0 as expected 40Done 41