$context = $this->getContext();
$this->setMwGlobals( 'wgActions', array(
'null' => null,
+ 'disabled' => false,
'dummy' => true,
'string' => 'NamedDummyAction',
'declared' => 'NonExistingClassName',
$this->assertType( $expected ?: 'null', $action );
}
+ public function testDisabledAction_exists() {
+ $exists = Action::exists( 'disabled' );
+
+ $this->assertTrue( $exists );
+ }
+
+ public function testDisabledAction_isNotResolved() {
+ $context = $this->getContext( 'disabled' );
+ $actionName = Action::getActionName( $context );
+
+ $this->assertEquals( 'nosuchaction', $actionName );
+ }
+
+ public function testDisabledAction_factoryReturnsFalse() {
+ $context = $this->getContext( 'disabled' );
+ $action = Action::factory( 'disabled', $context->getWikiPage(), $context );
+
+ $this->assertFalse( $action );
+ }
+
public function dummyActionCallback() {
$context = $this->getContext();
return new CalledDummyAction( $context->getWikiPage(), $context );