Merge "Revert "Log the reason why revision->getContent() returns null""
[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 class OracleInstallerTest extends MediaWikiTestCase {
10
11 /**
12 * @dataProvider provideOracleConnectStrings
13 * @covers OracleInstaller::checkConnectStringFormat
14 */
15 public function testCheckConnectStringFormat( $expected, $connectString, $msg = '' ) {
16 $validity = $expected ? 'should be valid' : 'should NOT be valid';
17 $msg = "'$connectString' ($msg) $validity.";
18 $this->assertEquals( $expected,
19 OracleInstaller::checkConnectStringFormat( $connectString ),
20 $msg
21 );
22 }
23
24 /**
25 * Provider to test OracleInstaller::checkConnectStringFormat()
26 */
27 function provideOracleConnectStrings() {
28 // expected result, connectString[, message]
29 return [
30 [ true, 'simple_01', 'Simple TNS name' ],
31 [ true, 'simple_01.world', 'TNS name with domain' ],
32 [ true, 'simple_01.domain.net', 'TNS name with domain' ],
33 [ true, 'host123', 'Host only' ],
34 [ true, 'host123.domain.net', 'FQDN only' ],
35 [ true, '//host123.domain.net', 'FQDN URL only' ],
36 [ true, '123.223.213.132', 'Host IP only' ],
37 [ true, 'host:1521', 'Host and port' ],
38 [ true, 'host:1521/service', 'Host, port and service' ],
39 [ true, 'host:1521/service:shared', 'Host, port, service and shared server type' ],
40 [ true, 'host:1521/service:dedicated', 'Host, port, service and dedicated server type' ],
41 [ true, 'host:1521/service:pooled', 'Host, port, service and pooled server type' ],
42 [
43 true,
44 'host:1521/service:shared/instance1',
45 'Host, port, service, server type and instance'
46 ],
47 [ true, 'host:1521//instance1', 'Host, port and instance' ],
48 ];
49 }
50
51 }