Page MenuHomeWickedGov Phorge

NotEmptyValidatorTest.php
No OneTemporary

Size
963 B
Referenced Files
None
Subscribers
None

NotEmptyValidatorTest.php

<?php
declare( strict_types = 1 );
use MediaWiki\Extension\Translate\Validation\Validators\NotEmptyValidator;
/**
* @license GPL-2.0-or-later
* @covers \MediaWiki\Extension\Translate\Validation\Validators\NotEmptyValidator
*/
class NotEmptyValidatorTest extends BaseValidatorTestCase {
/** @dataProvider provideTestCases */
public function test( ...$params ) {
$this->runValidatorTests( new NotEmptyValidator(), 'empty', ...$params );
}
public static function provideTestCases() {
yield [
'Hello',
'',
[ 'empty' ],
'should see a notice when an empty translation is provided.',
];
yield [
'Hello',
" \n ",
[ 'empty' ],
'should see a notice when a translation with newlines is provided.',
];
yield [
'Hello',
'Hello World',
[],
'should not see a notice when translation is not an empty string.',
];
yield [
'Hello',
null,
[],
'should not see a notice when translation is null.'
];
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 21:50 (2 d, 4 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
51/58/c43fb3d20f8a4b9077f3a22e8ebb
Default Alt Text
NotEmptyValidatorTest.php (963 B)

Event Timeline