1--TEST-- 2PDO OCI checkliveness (code coverage) 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 'ext/pdo/tests/pdo_test.inc'; 15$db = PDOTest::test_factory('ext/pdo_oci/tests/common.phpt'); 16 17$dsn = getenv('PDOTEST_DSN'); 18$user = getenv('PDOTEST_USER'); 19$pass = getenv('PDOTEST_PASS'); 20$attr = getenv('PDOTEST_ATTR'); 21 22try { 23 $db = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); 24} 25catch (PDOException $e) { 26 echo 'Connection failed: ' . $e->getMessage(); 27 exit; 28} 29 30// This triggers the call to check liveness 31try { 32 $db = new PDO($dsn, $user, $pass, array(PDO::ATTR_PERSISTENT => true)); 33} 34catch (PDOException $e) { 35 echo 'Connection failed: ' . $e->getMessage(); 36 exit; 37} 38 39$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); 40 41try { 42 $stmt = $db->prepare('SELECT * FROM dual'); 43 $stmt->execute(); 44 $row = $stmt->fetch(); 45 var_dump($row); 46} catch (PDOException $e) { 47 print $e->getMessage(); 48} 49 50$db = null; 51?> 52--EXPECT-- 53array(2) { 54 ["DUMMY"]=> 55 string(1) "X" 56 [0]=> 57 string(1) "X" 58} 59