diff options
Diffstat (limited to 'tests/phpunit/includes/ExternalStoreTest.php')
-rw-r--r-- | tests/phpunit/includes/ExternalStoreTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/phpunit/includes/ExternalStoreTest.php b/tests/phpunit/includes/ExternalStoreTest.php new file mode 100644 index 00000000..92ec7344 --- /dev/null +++ b/tests/phpunit/includes/ExternalStoreTest.php @@ -0,0 +1,32 @@ +<?php +/** + * External Store tests + */ + +class ExternalStoreTest extends MediaWikiTestCase { + private $saved_wgExternalStores; + + function setUp() { + global $wgExternalStores; + $this->saved_wgExternalStores = $wgExternalStores ; + } + + function tearDown() { + global $wgExternalStores; + $wgExternalStores = $this->saved_wgExternalStores ; + } + + function testExternalStoreDoesNotFetchIncorrectURL() { + global $wgExternalStores; + $wgExternalStores = true; + + # Assertions for r68900 + $this->assertFalse( + ExternalStore::fetchFromURL( 'http://' ) ); + $this->assertFalse( + ExternalStore::fetchFromURL( 'ftp.wikimedia.org' ) ); + $this->assertFalse( + ExternalStore::fetchFromURL( '/super.txt' ) ); + } +} + |