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