r74006 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74005‎ | r74006 | r74007 >
Date:23:57, 29 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Added some content for basic unit tests for ResourceLoader class.
Modified paths:
  • /trunk/phase3/includes/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ResourceLoader.php
@@ -199,6 +199,12 @@
200200 // A module has already been registered by this name
201201 throw new MWException( 'Another module has already been registered as ' . $name );
202202 }
 203+
 204+ // Validate the input (type hinting lets null through)
 205+ if ( !( $object instanceof ResourceLoaderModule ) ) {
 206+ throw new MWException( 'Invalid ResourceLoader module error. Instances of ResourceLoaderModule expected.' );
 207+ }
 208+
203209 // Attach module
204210 $this->modules[$name] = $object;
205211 $object->setName( $name );

Status & tagging log