Debian Codegraph @

extensions/Linter/tests/phpunit/CategoryMessagesTest.php

raw symbols SCIP
1 <?php
2 /**
3 * Copyright (C) 2017 Kunal Mehta <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21 namespace MediaWiki\Linter\Test;
22
23 use MediaWikiLangTestCase;
24
25 /**
26 * Test that all of the messages for new categories
27 * exist
28 */
29 class CategoryMessagesTest extends MediaWikiLangTestCase {
30
31 /**
32 * @coversNothing
33 */
34 public function testMessagesExistence() {
35 $services = $this->getServiceContainer();
36 $manager = $services->get( 'Linter.CategoryManager' );
37
38 foreach ( $manager->getVisibleCategories() as $category ) {
39 $msgs = [
40 "linter-category-$category",
41 "linter-category-$category-desc",
42 ];
43 if ( !$manager->hasNoParams( $category ) ) {
44 $msgs[] = "linter-pager-$category-details";
45 }
46 foreach ( $msgs as $msg ) {
47 $this->assertTrue(
48 wfMessage( $msg )->exists(),
49 "Missing '$msg' message"
50 );
51 }
52 }
53 }
54 }