http://www.mediawiki.org/wiki/Special:Code/MediaWiki/74006

Revision: 74006
Author:   tparscal
Date:     2010-09-29 23:57:53 +0000 (Wed, 29 Sep 2010)

Log Message:
-----------
Added some content for basic unit tests for ResourceLoader class.

Modified Paths:
--------------
    trunk/phase3/includes/ResourceLoader.php

Modified: trunk/phase3/includes/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/ResourceLoader.php    2010-09-29 23:27:26 UTC (rev 
74005)
+++ trunk/phase3/includes/ResourceLoader.php    2010-09-29 23:57:53 UTC (rev 
74006)
@@ -199,6 +199,12 @@
                        // A module has already been registered by this name
                        throw new MWException( 'Another module has already been 
registered as ' . $name );
                }
+               
+               // Validate the input (type hinting lets null through)
+               if ( !( $object instanceof ResourceLoaderModule ) ) {
+                       throw new MWException( 'Invalid ResourceLoader module 
error. Instances of ResourceLoaderModule expected.' );
+               }
+               
                // Attach module
                $this->modules[$name] = $object;
                $object->setName( $name );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to