23 'revisiondelete' => SpecialPageAction::class,
25 'string' =>
'NamedDummyAction',
26 'declared' =>
'NonExistingClassName',
27 'callable' => [ $this,
'dummyActionCallback' ],
33 return WikiPage::factory( Title::makeTitle( 0,
'Title' ) );
48 [
'dummy',
'DummyAction' ],
49 [
'string',
'NamedDummyAction' ],
50 [
'callable',
'CalledDummyAction' ],
51 [
'object',
'InstantiatedDummyAction' ],
54 [
'DUMMY',
'DummyAction' ],
55 [
'STRING',
'NamedDummyAction' ],
59 [
'undeclared', null ],
73 $this->assertSame( $expected !==
null, $exists );
80 $this->assertTrue( $exists );
92 $this->assertEquals( $expected ?:
'nosuchaction', $actionName );
100 $this->assertEquals(
'edit', $actionName );
108 $this->assertEquals(
'view', $actionName );
114 $context->getRequest()->setVal(
'revisiondelete',
true );
117 $this->assertEquals(
'revisiondelete', $actionName );
126 $this->assertEquals(
'view', $actionName );
138 $this->
assertType( $expected ?:
'null', $action );
144 $this->assertFalse( $exists );
151 $this->assertEquals(
'view', $actionName );
158 $this->assertNull( $action );
164 $this->assertTrue( $exists );
171 $this->assertEquals(
'nosuchaction', $actionName );
178 $this->assertFalse( $action );
191 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()
Get the RequestContext object associated with the main 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 $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