mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-12-22 12:42:43 +00:00
b35f956bca
https://docs.phpunit.de/en/11.4/annotations.html#covers recommends: Please note that this annotation requires a fully-qualified class name (FQCN). To make this more obvious to the reader, it is recommended to use a leading backslash (even if this not required for the annotation to work correctly). Change-Id: I58d381d8a5b378d0086bdce0717f42e885ea5b87
56 lines
1.6 KiB
PHP
56 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
*
|
|
* @file
|
|
* $since 1.42
|
|
*/
|
|
|
|
namespace MediaWiki\Skins\Vector\Tests\Unit\Services;
|
|
|
|
use MediaWiki\Skins\Vector\Services\LanguageService;
|
|
use MediaWikiUnitTestCase;
|
|
|
|
/**
|
|
* @group Vector
|
|
* @group Services
|
|
* @covers \MediaWiki\Skins\Vector\Services\LanguageService
|
|
*/
|
|
class LanguageServiceTest extends MediaWikiUnitTestCase {
|
|
|
|
public function provideSplittableLanguages(): array {
|
|
return [
|
|
[ 'en', true ],
|
|
[ 'de', true ],
|
|
[ 'fr', true ],
|
|
[ 'ja', true ],
|
|
[ 'ru', true ],
|
|
[ 'zh', true ],
|
|
[ 'ar', false ],
|
|
[ 'fa', false ],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* @dataProvider provideSplittableLanguages
|
|
*/
|
|
public function testCanWordsBeSplitSafely( string $code, bool $expected ) {
|
|
$languageService = new LanguageService();
|
|
$result = $languageService->canWordsBeSplitSafely( $code );
|
|
$this->assertSame( $expected, $result );
|
|
}
|
|
}
|