mirror of
https://github.com/php/php-src.git
synced 2024-12-14 12:26:19 +08:00
423b132a7a
(note OCI8 already builds with Oracle Database 12c)
44 lines
995 B
PHP
44 lines
995 B
PHP
--TEST--
|
|
PDO_OCI: Attribute: Client version
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
|
|
require(dirname(__FILE__).'/../../pdo/tests/pdo_test.inc');
|
|
PDOTest::skip();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
require(dirname(__FILE__) . '/../../pdo/tests/pdo_test.inc');
|
|
|
|
$dbh = PDOTest::factory();
|
|
|
|
echo "ATTR_CLIENT_VERSION: ";
|
|
$cv = $dbh->getAttribute(PDO::ATTR_CLIENT_VERSION);
|
|
var_dump($cv);
|
|
|
|
$s = explode(".", $cv);
|
|
if (count($s) > 1 && (($s[0] == 10 && $s[1] >= 2) || $s[0] >= 11)) {
|
|
if (count($s) != 5) {
|
|
echo "Wrong number of values in array\nVersion was: ";
|
|
var_dump($cv);
|
|
} else {
|
|
echo "Version OK, so far as can be portably checked\n";
|
|
}
|
|
} else {
|
|
if (count($s) != 2) {
|
|
echo "Wrong number of values in array\nVersion was: ";
|
|
var_dump($cv);
|
|
} else {
|
|
echo "Version OK, so far as can be portably checked\n";
|
|
}
|
|
}
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
ATTR_CLIENT_VERSION: string(%d) "%d.%s"
|
|
Version OK, so far as can be portably checked
|
|
Done
|