r76244 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76243‎ | r76244 | r76245 >
Date:13:07, 7 November 2010
Author:hashar
Status:deferred
Tags:
Comment:
Tests bad URL handling by ExternalStore::fetchFromURL()
Follow up r68900
Modified paths:
  • /trunk/phase3/maintenance/tests/phpunit/includes/ExternalStoreTest.php (added) (history)

Diff [purge]

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+

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r68900And one error suppression opertator less (per bug 24159)ialex19:10, 2 July 2010

Status & tagging log