| Conditions | 1 |
| Paths | 1 |
| Total Lines | 32 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function testLoadIwMapForExternalRepositoryMatch() { |
||
| 29 | |||
| 30 | $interwikiPrefixMap = array( |
||
| 31 | 'mw-foo' => array( |
||
| 32 | 'http://example.org:8080/mw-foo/index.php/$1', // corresponds to iw_url |
||
| 33 | 'http://example.org:8080/mw-foo/api.php', // corresponds to iw_api |
||
| 34 | true // corresponds to iw_local |
||
| 35 | ) |
||
| 36 | ); |
||
| 37 | |||
| 38 | $instance = new DynamicInterwikiPrefixLoader( $interwikiPrefixMap ); |
||
| 39 | |||
| 40 | $expected = array( |
||
| 41 | 'iw_prefix' => 'mw-foo', |
||
| 42 | 'iw_url' => 'http://example.org:8080/mw-foo/index.php/$1', |
||
| 43 | 'iw_api' => 'http://example.org:8080/mw-foo/api.php', |
||
| 44 | 'iw_wikiid' => 'mw-foo', |
||
| 45 | 'iw_local' => true, |
||
| 46 | 'iw_trans' => false |
||
| 47 | ); |
||
| 48 | |||
| 49 | $interwiki = array(); |
||
| 50 | |||
| 51 | $this->assertFalse( |
||
| 52 | $instance->tryToLoadIwMapForExternalRepository( 'mw-foo', $interwiki ) |
||
| 53 | ); |
||
| 54 | |||
| 55 | $this->assertEquals( |
||
| 56 | $expected, |
||
| 57 | $interwiki |
||
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 79 |