From c2f3948ecfcd0e8eec19efd304da46e7eee3305f Mon Sep 17 00:00:00 2001 From: X! Date: Mon, 3 Jan 2011 21:14:22 +0000 Subject: [PATCH] Followup r79523: Test that calling self:: and parent:: throws exception --- tests/phpunit/includes/MWFunctionTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/phpunit/includes/MWFunctionTest.php b/tests/phpunit/includes/MWFunctionTest.php index 9b32b406a7..ed5e760296 100644 --- a/tests/phpunit/includes/MWFunctionTest.php +++ b/tests/phpunit/includes/MWFunctionTest.php @@ -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(); } -- 2.20.1