Merge "LessFileCompilationTest: Check $file during the test, not in constructor"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Jul 2014 15:06:15 +0000 (15:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Jul 2014 15:06:15 +0000 (15:06 +0000)
tests/phpunit/includes/actions/ActionTest.php

index 6175ee6..eb370d9 100644 (file)
@@ -18,6 +18,8 @@ class ActionTest extends MediaWikiTestCase {
                        'null' => null,
                        'disabled' => false,
                        'view' => true,
+                       'edit' => true,
+                       'revisiondelete' => true,
                        'dummy' => true,
                        'string' => 'NamedDummyAction',
                        'declared' => 'NonExistingClassName',
@@ -89,6 +91,31 @@ class ActionTest extends MediaWikiTestCase {
                $this->assertEquals( $expected ?: 'nosuchaction', $actionName );
        }
 
+       public function testGetActionName_editredlinkWorkaround() {
+               // See https://bugzilla.wikimedia.org/show_bug.cgi?id=20966
+               $context = $this->getContext( 'editredlink' );
+               $actionName = Action::getActionName( $context );
+
+               $this->assertEquals( 'edit', $actionName );
+       }
+
+       public function testGetActionName_historysubmitWorkaround() {
+               // See https://bugzilla.wikimedia.org/show_bug.cgi?id=20966
+               $context = $this->getContext( 'historysubmit' );
+               $actionName = Action::getActionName( $context );
+
+               $this->assertEquals( 'view', $actionName );
+       }
+
+       public function testGetActionName_revisiondeleteWorkaround() {
+               // See https://bugzilla.wikimedia.org/show_bug.cgi?id=20966
+               $context = $this->getContext( 'historysubmit' );
+               $context->getRequest()->setVal( 'revisiondelete', true );
+               $actionName = Action::getActionName( $context );
+
+               $this->assertEquals( 'revisiondelete', $actionName );
+       }
+
        /**
         * @dataProvider actionProvider
         * @param string $requestedAction