1--TEST-- 2PDO OCI specific class constants 3--SKIPIF-- 4<?php 5if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded'); 6require(__DIR__.'/../../pdo/tests/pdo_test.inc'); 7PDOTest::skip(); 8?> 9--FILE-- 10<?php 11 12require(__DIR__ . '/../../pdo/tests/pdo_test.inc'); 13 14$expected = [ 15 'OCI_ATTR_CLIENT_INFO' => true, 16 'OCI_ATTR_ACTION' => true, 17 'OCI_ATTR_CLIENT_IDENTIFIER' => true, 18 'OCI_ATTR_MODULE' => true, 19]; 20 21$ref = new ReflectionClass('PDO'); 22$constants = $ref->getConstants(); 23$values = []; 24 25foreach ($constants as $name => $value) { 26 if (substr($name, 0, 8) == 'OCI_ATTR') { 27 if (!isset($values[$value])) { 28 $values[$value] = [$name]; 29 } else { 30 $values[$value][] = $name; 31 } 32 33 if (isset($expected[$name])) { 34 unset($expected[$name]); 35 unset($constants[$name]); 36 } 37 38 } else { 39 unset($constants[$name]); 40 } 41} 42 43if (!empty($constants)) { 44 printf("[001] Dumping list of unexpected constants\n"); 45 var_dump($constants); 46} 47 48if (!empty($expected)) { 49 printf("[002] Dumping list of missing constants\n"); 50 var_dump($expected); 51} 52 53if (!empty($values)) { 54 foreach ($values as $value => $constants) { 55 if (count($constants) > 1) { 56 printf("[003] Several constants share the same value '%s'\n", $value); 57 var_dump($constants); 58 } 59 } 60} 61 62print "done!"; 63--EXPECT-- 64done! 65