Improve tests for Action::exists
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Wed, 16 Jul 2014 16:56:35 +0000 (18:56 +0200)
committerThiemo Mättig (WMDE) <thiemo.maettig@wikimedia.de>
Fri, 18 Jul 2014 15:33:21 +0000 (15:33 +0000)
Change-Id: I905fd8e88ff625cd88c672ddac7a5ac4f4a94b36

tests/phpunit/includes/actions/ActionTest.php

index 1ebd908..839a0c5 100644 (file)
@@ -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