Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / tests / phpunit / maintenance / categoriesRdfTest.php
index b51c14c..be38aff 100644 (file)
@@ -1,5 +1,10 @@
 <?php
 
+namespace MediaWiki\Tests\Maintenance;
+
+use DumpCategoriesAsRdf;
+use MediaWikiLangTestCase;
+
 /**
  * @covers CategoriesRdf
  * @covers DumpCategoriesAsRdf
@@ -9,12 +14,33 @@ class CategoriesRdfTest extends MediaWikiLangTestCase {
                return [
                        // batch 1
                        [
-                               (object)[ 'page_title' => 'Category One', 'page_id' => 1 ],
-                               (object)[ 'page_title' => '2 Category Two', 'page_id' => 2 ],
+                               (object)[
+                                       'page_title' => 'Category One',
+                                       'page_id' => 1,
+                                       'pp_propname' => null,
+                                       'cat_pages' => '20',
+                                       'cat_subcats' => '10',
+                                       'cat_files' => '3'
+                               ],
+                               (object)[
+                                       'page_title' => '2 Category Two',
+                                       'page_id' => 2,
+                                       'pp_propname' => 'hiddencat',
+                                       'cat_pages' => 20,
+                                       'cat_subcats' => 0,
+                                       'cat_files' => 3
+                               ],
                        ],
                        // batch 2
                        [
-                               (object)[ 'page_title' => 'Третья категория', 'page_id' => 3 ],
+                               (object)[
+                                       'page_title' => 'Третья категория',
+                                       'page_id' => 3,
+                                       'pp_propname' => null,
+                                       'cat_pages' => '0',
+                                       'cat_subcats' => '0',
+                                       'cat_files' => '0'
+                               ],
                        ]
                ];
        }
@@ -32,7 +58,7 @@ class CategoriesRdfTest extends MediaWikiLangTestCase {
                        'wgServer' => 'http://acme.test',
                        'wgCanonicalServer' => 'http://acme.test',
                        'wgArticlePath' => '/wiki/$1',
-                       'wgRightsUrl' => '//creativecommons.org/licenses/by-sa/3.0/',
+                       'wgRightsUrl' => 'https://creativecommons.org/licenses/by-sa/3.0/',
                ] );
 
                $dumpScript =
@@ -64,8 +90,8 @@ class CategoriesRdfTest extends MediaWikiLangTestCase {
                $dumpScript->execute();
                $actualOut = file_get_contents( $outFileName );
                $actualOut = preg_replace(
-                       '|<http://acme.test/categoriesDump> <http://schema.org/dateModified> "[^"]+?"|',
-                       '<http://acme.test/categoriesDump> <http://schema.org/dateModified> "{DATE}"',
+                       '|<http://acme.test/wiki/Special:CategoryDump> <http://schema.org/dateModified> "[^"]+?"|',
+                       '<http://acme.test/wiki/Special:CategoryDump> <http://schema.org/dateModified> "{DATE}"',
                        $actualOut
                );