Annotation of embedaddon/php/ext/oci8/tests/drcp_cclass1.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: DRCP: Test setting connection class inline
3: --SKIPIF--
4: <?php
5: if (!extension_loaded('oci8')) die ("skip no oci8 extension");
6: require(dirname(__FILE__)."/details.inc");
7: if (!$test_drcp) die("skip testing DRCP connection class only works in DRCP mode");
8: if (strcasecmp($user, "system") && strcasecmp($user, "sys")) die("skip needs to be run as a DBA user");
9: ?>
10: --FILE--
11: <?php
12:
13: require(dirname(__FILE__)."/details.inc");
14:
15: // Initialization
16:
17: $t = time();
18: $cc1 = 'cc1_'.$t;
19: $cc2 = 'cc2_'.$t;
20:
21: // Run Test
22:
23: echo "Test 1\n";
24:
25: ini_set('oci8.connection_class', $cc1);
26: $c = oci_pconnect($user, $password, $dbase);
27: $s = oci_parse($c, "select * from dual");
28: oci_execute($s);
29: oci_fetch_all($s, $r);
30: var_dump($r);
31:
32: echo "Test 2\n";
33:
34: ini_set('oci8.connection_class', $cc2);
35: $c = oci_pconnect($user, $password, $dbase);
36: $s = oci_parse($c, "select * from dual");
37: oci_execute($s);
38: oci_fetch_all($s, $r);
39: var_dump($r);
40:
41: echo "Test 3\n";
42:
43: $s = oci_parse($c, "select cclass_name from v\$cpool_cc_stats where cclass_name like '%.cc__$t' order by cclass_name");
44: oci_execute($s);
45: oci_fetch_all($s, $r);
46: var_dump($r);
47:
48: // Cleanup
49:
50: echo "Done\n";
51:
52: ?>
53: --EXPECTF--
54: Test 1
55: array(1) {
56: ["DUMMY"]=>
57: array(1) {
58: [0]=>
59: string(1) "X"
60: }
61: }
62: Test 2
63: array(1) {
64: ["DUMMY"]=>
65: array(1) {
66: [0]=>
67: string(1) "X"
68: }
69: }
70: Test 3
71: array(1) {
72: ["CCLASS_NAME"]=>
73: array(2) {
74: [0]=>
75: string(21) "%s.cc1_%d"
76: [1]=>
77: string(21) "%s.cc2_%d"
78: }
79: }
80: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>