From 8e30b1c9b46069768392f92d97b5d7d2911314f0 Mon Sep 17 00:00:00 2001 From: Morne Alberts Date: Sat, 5 Nov 2022 14:51:12 +0200 Subject: [PATCH] Add stub special page (#7) * Add stub special page * Try type hint --- WikibaseExport.i18n.alias.php | 7 +++++++ extension.json | 5 +++++ i18n/en.json | 4 +++- i18n/qqq.json | 3 ++- src/SpecialWikibaseExport.php | 28 ++++++++++++++++++++++++++++ tests/SpecialWikibaseExportTest.php | 29 +++++++++++++++++++++++++++++ 6 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 WikibaseExport.i18n.alias.php create mode 100644 src/SpecialWikibaseExport.php create mode 100644 tests/SpecialWikibaseExportTest.php diff --git a/WikibaseExport.i18n.alias.php b/WikibaseExport.i18n.alias.php new file mode 100644 index 0000000..a4ed1c3 --- /dev/null +++ b/WikibaseExport.i18n.alias.php @@ -0,0 +1,7 @@ + [ 'WikibaseExport' ], +]; diff --git a/extension.json b/extension.json index 9552af4..e8f245e 100644 --- a/extension.json +++ b/extension.json @@ -40,6 +40,7 @@ }, "SpecialPages": { + "WikibaseExport": "ProfessionalWiki\\WikibaseExport\\SpecialWikibaseExport" }, "ResourceFileModulePaths": { @@ -50,5 +51,9 @@ "ResourceModules": { }, + "ExtensionMessagesFiles": { + "WikibaseExportAlias": "WikibaseExport.i18n.alias.php" + }, + "manifest_version": 2 } diff --git a/i18n/en.json b/i18n/en.json index ba87f58..1d73d2f 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -5,5 +5,7 @@ ] }, "wikibase-export-name": "Wikibase Export", - "wikibase-export-description": "Adds a user-friendly Wikibase export page" + "wikibase-export-description": "Adds a user-friendly Wikibase export page", + + "special-wikibase-export": "Wikibase Export" } diff --git a/i18n/qqq.json b/i18n/qqq.json index 4819b02..e4e9f93 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -6,5 +6,6 @@ ] }, "wikibase-rdf-name": "{{notranslate}}", - "wikibase-rdf-description": "{{Desc|name=Wikibase Export|url=https://github.com/ProfessionalWiki/WikibaseExport}}" + "wikibase-rdf-description": "{{Desc|name=Wikibase Export|url=https://github.com/ProfessionalWiki/WikibaseExport}}", + "special-wikibase-export": "This is the label on \"Special:WikibaseExport\"." } diff --git a/src/SpecialWikibaseExport.php b/src/SpecialWikibaseExport.php new file mode 100644 index 0000000..9dd9177 --- /dev/null +++ b/src/SpecialWikibaseExport.php @@ -0,0 +1,28 @@ +getOutput()->addHTML( 'TODO' ); + } + + public function getGroupName(): string { + return 'wikibase'; + } + + public function getDescription(): string { + return $this->msg( 'special-wikibase-export' )->escaped(); + } + +} diff --git a/tests/SpecialWikibaseExportTest.php b/tests/SpecialWikibaseExportTest.php new file mode 100644 index 0000000..f158e46 --- /dev/null +++ b/tests/SpecialWikibaseExportTest.php @@ -0,0 +1,29 @@ +executeSpecialPage(); + + $this->assertStringContainsString( + 'TODO', + $output + ); + } + +}