Page MenuHomeWickedGov Phorge

InsertableRubyVariableValidatorTest.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

InsertableRubyVariableValidatorTest.php

<?php
declare( strict_types = 1 );
use MediaWiki\Extension\Translate\Validation\Validators\InsertableRubyVariableValidator;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\InsertableRubyVariableValidator
*/
class InsertableRubyVariableValidatorTest extends BaseValidatorTestCase {
/** @dataProvider provideTestCases */
public function test( ...$params ) {
$this->runValidatorTests( new InsertableRubyVariableValidator(), 'variable', ...$params );
}
public static function provideTestCases() {
yield [
'Test variable - %{ruby} %{ruby2}',
'%{hello} - Testing translation',
[ 'missing', 'unknown' ],
'should return proper notices for missing and non-matching variables.'
];
yield [
'Testing variables - %{ruby} %{php}',
'Another testing - %{ruby} %{ruby2}',
[ 'missing' ],
'should see a notice set when parameter names don\'t match.'
];
yield [
'Testing variables - %{ruby} %{php}',
'Another testing - %{ruby} %{php}',
[],
'should not set any notice for a valid message.'
];
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Nov 23, 02:46 (2 d, 21 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9c/3a/58b04e2b1ccb54ff15e9fe36cc63
Default Alt Text
InsertableRubyVariableValidatorTest.php (1 KB)

Event Timeline