2017-10-17 00:27:52 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2021-04-12 02:08:44 +00:00
|
|
|
* Copyright (C) 2017 Kunal Mehta <legoktm@debian.org>
|
2017-10-17 00:27:52 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MediaWiki\Linter\Test;
|
|
|
|
|
2018-02-06 05:54:30 +00:00
|
|
|
use MediaWikiLangTestCase;
|
2017-10-17 00:27:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Test that all of the messages for new categories
|
|
|
|
* exist
|
|
|
|
*/
|
2018-02-06 05:54:30 +00:00
|
|
|
class CategoryMessagesTest extends MediaWikiLangTestCase {
|
2017-10-17 00:27:52 +00:00
|
|
|
|
|
|
|
/**
|
2018-02-06 05:54:30 +00:00
|
|
|
* @coversNothing
|
2017-10-17 00:27:52 +00:00
|
|
|
*/
|
2024-04-04 22:55:43 +00:00
|
|
|
public function testMessagesExistence() {
|
|
|
|
$services = $this->getServiceContainer();
|
|
|
|
$manager = $services->get( 'Linter.CategoryManager' );
|
|
|
|
|
|
|
|
foreach ( $manager->getVisibleCategories() as $category ) {
|
|
|
|
$msgs = [
|
|
|
|
"linter-category-$category",
|
|
|
|
"linter-category-$category-desc",
|
|
|
|
];
|
|
|
|
if ( !$manager->hasNoParams( $category ) ) {
|
|
|
|
$msgs[] = "linter-pager-$category-details";
|
|
|
|
}
|
|
|
|
foreach ( $msgs as $msg ) {
|
|
|
|
$this->assertTrue(
|
|
|
|
wfMessage( $msg )->exists(),
|
|
|
|
"Missing '$msg' message"
|
|
|
|
);
|
|
|
|
}
|
2018-02-06 05:54:30 +00:00
|
|
|
}
|
2017-10-17 00:27:52 +00:00
|
|
|
}
|
|
|
|
}
|