wiki.techinc.nl/tests/phpunit/unit/includes/actions/ActionInfoTest.php
Reedy 85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00

43 lines
1 KiB
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() );
}
}