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