Selenium: replace UserLoginPage with BlankPage where possible
[lhc/web/wiklou.git] / tests / phpunit / includes / installer / OracleInstallerTest.php
1 <?php
2
3 /**
4 * @group Database
5 * @group Installer
6 */
7 class OracleInstallerTest extends MediaWikiTestCase {
8
9 /**
10 * @dataProvider provideOracleConnectStrings
11 * @covers OracleInstaller::checkConnectStringFormat
12 */
13 public function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) {
14 $validity = $expected ? 'should be valid' : 'should NOT be valid';
15 $msg = "'$connectString' ($msg) $validity.";
16 $this->assertEquals( $expected,
17 OracleInstaller::checkConnectStringFormat( $connectString ),
18 $msg
19 );
20 }
21
22 /**
23 * Provider to test OracleInstaller::checkConnectStringFormat()
24 */
25 function provideOracleConnectStrings() {
26 // expected result, connectString[, message]
27 return [
28 [ true, 'simple_01', 'Simple TNS name' ],
29 [ true, 'simple_01.world', 'TNS name with domain' ],
30 [ true, 'simple_01.domain.net', 'TNS name with domain' ],
31 [ true, 'host123', 'Host only' ],
32 [ true, 'host123.domain.net', 'FQDN only' ],
33 [ true, '//host123.domain.net', 'FQDN URL only' ],
34 [ true, '123.223.213.132', 'Host IP only' ],
35 [ true, 'host:1521', 'Host and port' ],
36 [ true, 'host:1521/service', 'Host, port and service' ],
37 [ true, 'host:1521/service:shared', 'Host, port, service and shared server type' ],
38 [ true, 'host:1521/service:dedicated', 'Host, port, service and dedicated server type' ],
39 [ true, 'host:1521/service:pooled', 'Host, port, service and pooled server type' ],
40 [
41 true,
42 'host:1521/service:shared/instance1',
43 'Host, port, service, server type and instance'
44 ],
45 [ true, 'host:1521//instance1', 'Host, port and instance' ],
46 ];
47 }
48
49 }