Annotation of embedaddon/php/ext/oci8/tests/extauth_01.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test External Authentication errors with oci_connect
3: --SKIPIF--
4: <?php
5: if (!extension_loaded('oci8')) die ("skip no oci8 extension");
6: if (substr(PHP_OS, 0, 3) == 'WIN') die("skip feature not available on Windows platforms");
7: require(dirname(__FILE__).'/details.inc');
8: if (getenv('SKIP_SLOW_TESTS')) die('skip slow tests excluded by request');
9: ?>
10: --INI--
11: oci8.privileged_connect=1
12: --FILE--
13: <?php
14:
15: // Run Test
16:
17: echo "Test 1\n";
18:
19: $c = oci_connect('/', 'notemtpy', 'anything', null, OCI_CRED_EXT);
20: if (!$c) {
21: $m = oci_error();
22: var_dump($m);
23: }
24: var_dump($c);
25:
26: echo "Test 2\n";
27:
28: $c = oci_connect('notemtpy', 'notemtpy', 'anything', null, OCI_CRED_EXT);
29: if (!$c) {
30: $m = oci_error();
31: var_dump($m);
32: }
33: var_dump($c);
34:
35: echo "Test 3\n";
36:
37: $c = oci_connect('notemtpy', '', 'anything', null, OCI_CRED_EXT);
38: if (!$c) {
39: $m = oci_error();
40: var_dump($m);
41: }
42: var_dump($c);
43:
44: echo "Test 4\n";
45:
46: $c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER);
47: if (!$c) {
48: $m = oci_error();
49: var_dump($m);
50: }
51: var_dump($c);
52:
53: echo "Test 5\n";
54:
55: $c = oci_connect('a', 'b', 'c', null, OCI_SYSDBA+OCI_SYSOPER+OCI_CRED_EXT);
56: if (!$c) {
57: $m = oci_error();
58: var_dump($m);
59: }
60: var_dump($c);
61:
62: echo "Test 6\n";
63:
64: $c = oci_connect('', '', 'anything', null, OCI_CRED_EXT);
65: if (!$c) {
66: $m = oci_error();
67: var_dump($m);
68: }
69: var_dump($c);
70:
71: echo "Test 7\n";
72:
73: $c = oci_connect('/', '', 'anything', null, OCI_CRED_EXT);
74: if (!$c) {
75: $m = oci_error();
76: var_dump($m);
77: }
78: var_dump($c);
79:
80: echo "Test 8\n";
81:
82: $c = oci_connect('/', null, 'anything', null, OCI_CRED_EXT);
83: if (!$c) {
84: $m = oci_error();
85: var_dump($m);
86: }
87: var_dump($c);
88:
89: echo "Test 9\n";
90:
91: $c = oci_connect('/', '', 'c', null, OCI_SYSDBA+OCI_CRED_EXT);
92: if (!$c) {
93: $m = oci_error();
94: var_dump($m);
95: }
96: var_dump($c);
97:
98: echo "Test 10\n";
99:
100: $c = oci_connect('/', '', 'c', null, OCI_SYSOPER+OCI_CRED_EXT);
101: if (!$c) {
102: $m = oci_error();
103: var_dump($m);
104: }
105: var_dump($c);
106:
107:
108: ?>
109: ===DONE===
110: <?php exit(0); ?>
111: --EXPECTF--
112: Test 1
113:
114: Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
115: bool(false)
116: bool(false)
117: Test 2
118:
119: Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
120: bool(false)
121: bool(false)
122: Test 3
123:
124: Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
125: bool(false)
126: bool(false)
127: Test 4
128:
129: Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
130: bool(false)
131: bool(false)
132: Test 5
133:
134: Warning: oci_connect(): OCI_SYSDBA and OCI_SYSOPER cannot be used together in %s on line %d
135: bool(false)
136: bool(false)
137: Test 6
138:
139: Warning: oci_connect(): OCI_CRED_EXT can only be used with a username of "/" and a NULL password in %s on line %d
140: bool(false)
141: bool(false)
142: Test 7
143:
144: Warning: oci_connect(): ORA-12154: %s in %s on line %d
145: array(4) {
146: [%u|b%"code"]=>
147: int(12154)
148: [%u|b%"message"]=>
149: %unicode|string%(%d) "ORA-12154: %s"
150: [%u|b%"offset"]=>
151: int(0)
152: [%u|b%"sqltext"]=>
153: %unicode|string%(0) ""
154: }
155: bool(false)
156: Test 8
157:
158: Warning: oci_connect(): ORA-12154: %s in %s on line %d
159: array(4) {
160: [%u|b%"code"]=>
161: int(12154)
162: [%u|b%"message"]=>
163: %unicode|string%(%d) "ORA-12154: %s"
164: [%u|b%"offset"]=>
165: int(0)
166: [%u|b%"sqltext"]=>
167: %unicode|string%(0) ""
168: }
169: bool(false)
170: Test 9
171:
172: Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d
173: array(4) {
174: [%u|b%"code"]=>
175: int(%d)
176: [%u|b%"message"]=>
177: %unicode|string%(%d) "ORA-%d: %s"
178: [%u|b%"offset"]=>
179: int(0)
180: [%u|b%"sqltext"]=>
181: %unicode|string%(0) ""
182: }
183: bool(false)
184: Test 10
185:
186: Warning: oci_connect(): ORA-%d: TNS:%s in %s on line %d
187: array(4) {
188: [%u|b%"code"]=>
189: int(%d)
190: [%u|b%"message"]=>
191: %unicode|string%(%d) "ORA-%d: %s"
192: [%u|b%"offset"]=>
193: int(0)
194: [%u|b%"sqltext"]=>
195: %unicode|string%(0) ""
196: }
197: bool(false)
198: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>