From 5043b4993b266a47a94a578c82377b57121e3af4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Thu, 17 Jul 2014 10:14:29 +0200 Subject: [PATCH] Add tests for IE workarounds to ActionTest Change-Id: Iafaa3266e57f22f108c0253053103681bd88bd10 --- tests/phpunit/includes/actions/ActionTest.php | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/phpunit/includes/actions/ActionTest.php b/tests/phpunit/includes/actions/ActionTest.php index 6175ee6bd6..eb370d9204 100644 --- a/tests/phpunit/includes/actions/ActionTest.php +++ b/tests/phpunit/includes/actions/ActionTest.php @@ -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 -- 2.20.1