Followup r79523: Test that calling self:: and parent:: throws exception
authorX! <soxred93@users.mediawiki.org>
Mon, 3 Jan 2011 21:14:22 +0000 (21:14 +0000)
committerX! <soxred93@users.mediawiki.org>
Mon, 3 Jan 2011 21:14:22 +0000 (21:14 +0000)
tests/phpunit/includes/MWFunctionTest.php

index 9b32b40..ed5e760 100644 (file)
@@ -50,6 +50,22 @@ class MWFunctionTest extends MediaWikiTestCase {
                
        }
        
+       /**
+        * @expectedException MWException
+        */
+       function testCallingParentFails() {
+               
+               MWFunction::call( 'parent::foo' );
+       }
+       
+       /**
+        * @expectedException MWException
+        */
+       function testCallingSelfFails() {
+               
+               MWFunction::call( 'self::foo' );
+       }
+       
        public static function someMethod() {
                return func_get_args();
        }