22 'revisiondelete' =>
'SpecialPageAction',
24 'string' =>
'NamedDummyAction',
25 'declared' =>
'NonExistingClassName',
26 'callable' => [ $this,
'dummyActionCallback' ],
47 [
'dummy',
'DummyAction' ],
48 [
'string',
'NamedDummyAction' ],
49 [
'callable',
'CalledDummyAction' ],
50 [
'object',
'InstantiatedDummyAction' ],
53 [
'DUMMY',
'DummyAction' ],
54 [
'STRING',
'NamedDummyAction' ],
58 [
'undeclared', null ],
72 $this->assertSame( $expected !==
null, $exists );
79 $this->assertTrue( $exists );
91 $this->assertEquals( $expected ?:
'nosuchaction', $actionName );
99 $this->assertEquals(
'edit', $actionName );
107 $this->assertEquals(
'view', $actionName );
113 $context->getRequest()->setVal(
'revisiondelete',
true );
116 $this->assertEquals(
'revisiondelete', $actionName );
125 $this->assertEquals(
'view', $actionName );
137 $this->
assertType( $expected ?:
'null', $action );
143 $this->assertFalse( $exists );
150 $this->assertEquals(
'view', $actionName );
157 $this->assertNull( $action );
163 $this->assertTrue( $exists );
170 $this->assertEquals(
'nosuchaction', $actionName );
177 $this->assertFalse( $action );
190 return static::class;
testActionExists_doesNotRequireInstantiation()
testDisabledAction_exists()
testGetActionName_revisiondeleteWorkaround()
testGetActionName( $requestedAction, $expected)
actionProvider
testGetActionName_editredlinkWorkaround()
testGetActionName_whenCanNotUseWikiPage_defaultsToView()
testDisabledAction_factoryReturnsFalse()
testActionFactory( $requestedAction, $expected)
actionProvider
testGetActionName_historysubmitWorkaround()
getContext( $requestedAction=null)
testNull_defaultsToView()
testDisabledAction_isNotResolved()
testActionExists( $requestedAction, $expected)
actionProvider
testNull_canNotBeInstantiated()
Actions are things which can be done to pages (edit, delete, rollback, etc).
static factory( $action, Page $page, IContextSource $context=null)
Get an appropriate Action subclass for the given action.
static getActionName(IContextSource $context)
Get the action that will be executed, not necessarily the one passed passed through the "action" requ...
static exists( $name)
Check if a given action is recognised, even if it's disabled.
An IContextSource implementation which will inherit context from another source but allow individual ...
getName()
Return the name of the action this object responds to.
show()
The main action entry point.
WebRequest clone which takes values from a provided array.
static getMain()
Static methods.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context