Page MenuHomeWickedGov Phorge

MatchSetValidatorTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

MatchSetValidatorTest.php

<?php
declare( strict_types = 1 );
use MediaWiki\Extension\Translate\Validation\Validators\MatchSetValidator;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\MatchSetValidator
*/
class MatchSetValidatorTest extends BaseValidatorTestCase {
/** @dataProvider provideTestCases */
public function test( $constructorParams, ...$params ) {
$validator = new MatchSetValidator( $constructorParams );
$this->runValidatorTests( $validator, 'value-not-present', ...$params );
}
public static function provideTestCases() {
yield [
[ 'values' => [ 'rtl', 'Ltr' ] ],
'rtl',
'ltr',
[ 'invalid' ],
'Wrong case (case-sensitive) is an issue'
];
yield [
[ 'values' => [ 'rtl', 'Ltr' ], 'caseSensitive' => false ],
'rtl',
'ltr',
[],
'Matching value (case-insensitive) is not an issue'
];
yield [
[ 'values' => [ 'rtl', 'etc' ] ],
'rtl',
'ltr',
[ 'invalid' ],
'Wrong value (case-sensitive) is an issue'
];
}
public function testEmptyValues() {
$this->expectException( InvalidArgumentException::class );
new MatchSetValidator( [
'values' => [],
] );
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 21:54 (2 d, 4 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
20/44/67de7838af4f871ede6a2a6d656c
Default Alt Text
MatchSetValidatorTest.php (1 KB)

Event Timeline