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