Annotation of embedaddon/php/ext/oci8/tests/drcp_characterset.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: DRCP: oci_pconnect() and oci_connect() with different character sets
3: --SKIPIF--
4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
5: --FILE--
6: <?php
7:
8: require dirname(__FILE__)."/details.inc";
9:
10: // Create connections with oci_connect and oci_pconnect with UTF8 as Charset
11:
12: $c1 = oci_connect($user,$password,$dbase,"UTF8");
13: var_dump($c1);
14:
15: // Now with oci_pconnect()
16:
17: $p1 = oci_pconnect($user,$password,$dbase,"UTF8");
18: var_dump($p1);
19:
20: // Create two more connections with character set US7ASCII
21:
22: $c2 = oci_connect($user,$password,$dbase,"US7ASCII");
23: var_dump($c2);
24:
25: // Now with oci_pconnect()
26:
27: $p2 = oci_pconnect($user,$password,$dbase,"US7ASCII");
28: var_dump($p2);
29:
30: // The two connections c1 and c2 should not share resources as they use different
31: //character sets
32:
33: if((int)$c1 === (int)$c2)
34: echo "First and third connections share a resource: NOT OK\n";
35: else
36: echo "First and third connections are different: OK\n";
37:
38: // The two connections p1 and p2 should not share resources as they use different
39: //character sets
40:
41: if((int)$p1 === (int)$p2)
42: echo "Second and fourth connections share a resource: NOT OK\n";
43: else
44: echo "Second and fourth connections are different: OK\n";
45:
46: // Close all the connections
47: oci_close($c1);
48: oci_close($c2);
49: oci_close($p1);
50: oci_close($p2);
51:
52: echo "Done\n";
53: ?>
54: --EXPECTF--
55: resource(%d) of type (oci8 connection)
56: resource(%d) of type (oci8 persistent connection)
57: resource(%d) of type (oci8 connection)
58: resource(%d) of type (oci8 persistent connection)
59: First and third connections are different: OK
60: Second and fourth connections are different: OK
61: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>