summaryrefslogtreecommitdiff
path: root/tests/phpunit/includes/actions/ActionTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/phpunit/includes/actions/ActionTest.php')
-rw-r--r--tests/phpunit/includes/actions/ActionTest.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/phpunit/includes/actions/ActionTest.php b/tests/phpunit/includes/actions/ActionTest.php
index cc6fb11a..3babb97f 100644
--- a/tests/phpunit/includes/actions/ActionTest.php
+++ b/tests/phpunit/includes/actions/ActionTest.php
@@ -3,7 +3,6 @@
/**
* @covers Action
*
- * @licence GNU GPL v2+
* @author Thiemo Mättig
*
* @group Action
@@ -20,7 +19,7 @@ class ActionTest extends MediaWikiTestCase {
'disabled' => false,
'view' => true,
'edit' => true,
- 'revisiondelete' => true,
+ 'revisiondelete' => 'SpecialPageAction',
'dummy' => true,
'string' => 'NamedDummyAction',
'declared' => 'NonExistingClassName',
@@ -117,6 +116,15 @@ class ActionTest extends MediaWikiTestCase {
$this->assertEquals( 'revisiondelete', $actionName );
}
+ public function testGetActionName_whenCanNotUseWikiPage_defaultsToView() {
+ $request = new FauxRequest( array( 'action' => 'edit' ) );
+ $context = new DerivativeContext( RequestContext::getMain() );
+ $context->setRequest( $request );
+ $actionName = Action::getActionName( $context );
+
+ $this->assertEquals( 'view', $actionName );
+ }
+
/**
* @dataProvider actionProvider
* @param string $requestedAction