From bf0d2a110adddccb035c82bce319fa1bfdbf4d0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Wed, 16 Jul 2014 18:56:35 +0200 Subject: [PATCH] Improve tests for Action::exists Change-Id: I905fd8e88ff625cd88c672ddac7a5ac4f4a94b36 --- tests/phpunit/includes/actions/ActionTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/phpunit/includes/actions/ActionTest.php b/tests/phpunit/includes/actions/ActionTest.php index 1ebd9083d1..839a0c5c5e 100644 --- a/tests/phpunit/includes/actions/ActionTest.php +++ b/tests/phpunit/includes/actions/ActionTest.php @@ -17,6 +17,7 @@ class ActionTest extends MediaWikiTestCase { 'null' => null, 'dummy' => true, 'string' => 'NamedDummyAction', + 'declared' => 'NonExistingClassName', 'callable' => array( $this, 'dummyActionCallback' ), 'object' => new InstantiatedDummyAction( $this->getPage(), $this->getContext() ), ) ); @@ -59,6 +60,13 @@ class ActionTest extends MediaWikiTestCase { $this->assertEquals( isset( $expected ), $exists ); } + public function testActionExists_doesNotRequireInstantiation() { + // The method is not supposed to check if the action can be instantiated. + $exists = Action::exists( 'declared' ); + + $this->assertTrue( $exists ); + } + /** * @dataProvider actionProvider * @param string $requestedAction -- 2.20.1