From: Thiemo Mättig Date: Wed, 16 Jul 2014 16:56:35 +0000 (+0200) Subject: Improve tests for Action::exists X-Git-Tag: 1.31.0-rc.0~14892 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=bf0d2a110adddccb035c82bce319fa1bfdbf4d0b;p=lhc%2Fweb%2Fwiklou.git Improve tests for Action::exists Change-Id: I905fd8e88ff625cd88c672ddac7a5ac4f4a94b36 --- 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