Index: trunk/phase3/maintenance/tests/phpunit/includes/ExternalStoreTest.php |
— | — | @@ -0,0 +1,32 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * External Store tests |
| 5 | + */ |
| 6 | + |
| 7 | +class ExternalStoreTest extends PHPUnit_Framework_TestCase { |
| 8 | + private $saved_wgExternalStores; |
| 9 | + |
| 10 | + function setUp() { |
| 11 | + global $wgExternalStores; |
| 12 | + $this->saved_wgExternalStores = $wgExternalStores ; |
| 13 | + } |
| 14 | + |
| 15 | + function tearDown() { |
| 16 | + global $wgExternalStores; |
| 17 | + $wgExternalStores = $this->saved_wgExternalStores ; |
| 18 | + } |
| 19 | + |
| 20 | + function testExternalStoreDoesNotFetchIncorrectURL() { |
| 21 | + global $wgExternalStores; |
| 22 | + $wgExternalStores = true; |
| 23 | + |
| 24 | + # Assertions for r68900 |
| 25 | + $this->assertFalse( |
| 26 | + ExternalStore::fetchFromURL( 'http://' ) ); |
| 27 | + $this->assertFalse( |
| 28 | + ExternalStore::fetchFromURL( 'ftp.wikimedia.org' ) ); |
| 29 | + $this->assertFalse( |
| 30 | + ExternalStore::fetchFromURL( '/super.txt' ) ); |
| 31 | + } |
| 32 | +} |
| 33 | + |