Page MenuHomeWickedGov Phorge

ActionInfoTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

ActionInfoTest.php

<?php
use MediaWiki\Actions\ActionInfo;
/**
* @covers \MediaWiki\Actions\ActionInfo
*
* @author Daniel Kinzler
*/
class ActionInfoTest extends MediaWikiUnitTestCase {
public static function provideSpec() {
yield 'true values' => [ [
'name' => 'testing',
'restriction' => 'foo',
'requiresUnblock' => true,
'requiresWrite' => true,
'needsReadRights' => true,
] ];
yield 'false values' => [ [
'name' => 'testing',
'restriction' => null,
'requiresUnblock' => false,
'requiresWrite' => false,
'needsReadRights' => false,
] ];
}
/**
* @dataProvider provideSpec
*/
public function testGetters( array $spec ) {
$info = new ActionInfo( $spec );
$this->assertSame( $spec['name'], $info->getName() );
$this->assertSame( $spec['restriction'], $info->getRestriction() );
$this->assertSame( $spec['requiresUnblock'], $info->requiresUnblock() );
$this->assertSame( $spec['requiresWrite'], $info->requiresWrite() );
$this->assertSame( $spec['needsReadRights'], $info->needsReadRights() );
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Nov 21, 16:52 (10 h, 51 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
76/05/bec35ee7144a4ca9c5c54a4c0e2f
Default Alt Text
ActionInfoTest.php (1 KB)

Event Timeline