id
int64
0
1.29M
original_id
stringlengths
32
32
swhid
stringlengths
100
170
sha1
stringlengths
40
40
repo_name
stringlengths
2
45
repo_group
stringclasses
12 values
filepath
stringlengths
5
153
name
stringlengths
1
14.9k
type
stringclasses
3 values
code
stringlengths
7
2.12M
15,500
4df3602a5e991d565af5cda05e23ceda
swh:1:cnt:e5576615ddfbe2c573403bf3547da7581a2e5422;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=9-66/
b3f2bbf59de2abef2c9630beee145dd9b1b7d10d
ArticlePlaceholder
deployed
includes/Lua/ArticlePlaceholderLibrary.php
ArticlePlaceholderLibrary
type
/** * Registers and defines functions needed by the Lua modules * * @license GPL-2.0-or-later * @author Lucie-Aimée Kaffee */ class ArticlePlaceholderLibrary extends LibraryBase { /** * @return string[] */ public function getImageProperty() { $config = MediaWikiServices::getInstance()->getMainConfig(); ...
15,501
d0a4f5a6ba7e1ddf30381fe4d410eec2
swh:1:cnt:e5576615ddfbe2c573403bf3547da7581a2e5422;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=17-30/
b3f2bbf59de2abef2c9630beee145dd9b1b7d10d
ArticlePlaceholder
deployed
includes/Lua/ArticlePlaceholderLibrary.php
ArticlePlaceholderLibrary::getImageProperty()
function
/** * @return string[] */ public function getImageProperty() { $config = MediaWikiServices::getInstance()->getMainConfig(); $imageProperty = $config->get( 'ArticlePlaceholderImageProperty' ); if ( !is_string( $imageProperty ) || $imageProperty === '' ) { throw new ConfigException( 'Bad value in $w...
15,502
0e396cad1d1a005c59a3b0b9d6b2555f
swh:1:cnt:e5576615ddfbe2c573403bf3547da7581a2e5422;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=49-64/
b3f2bbf59de2abef2c9630beee145dd9b1b7d10d
ArticlePlaceholder
deployed
includes/Lua/ArticlePlaceholderLibrary.php
ArticlePlaceholderLibrary::register()
function
/** * @return array */ public function register() { // These functions will be exposed to the Lua module. // They are member functions on a Lua table which is private to the module, thus // these can't be called from user code, unless explicitly exposed in Lua. $lib = [ 'getImageProperty' => [ $this, 'g...
15,503
04bb664ecbcaf88be797efc1cc163ce8
swh:1:cnt:e5576615ddfbe2c573403bf3547da7581a2e5422;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=32-47/
b3f2bbf59de2abef2c9630beee145dd9b1b7d10d
ArticlePlaceholder
deployed
includes/Lua/ArticlePlaceholderLibrary.php
ArticlePlaceholderLibrary::getReferencePropertyToHide()
function
/** * Returns an array containing the serialization of a single reference property id to hide * * @return string[]|null Null if $wgArticlePlaceholderReferencesBlacklist empty or not string */ public function getReferencePropertyToHide() { $config = MediaWikiServices::getInstance()->getMainConfig(); $refere...
15,504
a8dffdcfbea8b79e91b95d6f9dc04f22
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=21-222/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic
type
/** * The AboutTopic SpecialPage for the ArticlePlaceholder extension * * @ingroup Extensions * @license GPL-2.0-or-later * @author Lucie-Aimée Kaffee */ class SpecialAboutTopic extends SpecialPage { public static function newFromGlobalState( Config $config, LanguageNameUtils $languageNameUtils, Permissio...
15,505
2542a13d93cd735c02e2e4230eea0095
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=30-61/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::newFromGlobalState( Config $config, LanguageNameUtils $languageNameUtils, PermissionManager $permissionManager, SiteLookup $siteLookup, TitleFactory $titleFactory, )
function
public static function newFromGlobalState( Config $config, LanguageNameUtils $languageNameUtils, PermissionManager $permissionManager, SiteLookup $siteLookup, TitleFactory $titleFactory, ): self { // TODO inject services $mwServices = MediaWikiServices::getInstance(); $settings = WikibaseClient::getSet...
15,506
905be020f15ccb392f2480e965c1131e
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=75-80/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::execute( $sub )
function
/** * @param string|null $sub */ public function execute( $sub ) { $this->showContent( $sub ); }
15,507
2483f796b5c636fb181cbc809ff117ad
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=123-128/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::getDescription()
function
/** * @inheritDoc */ public function getDescription() { return $this->msg( 'articleplaceholder-abouttopic' ); }
15,508
0d5b0d8904087bc9e9188df82a7d3419
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=63-73/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::__construct( private readonly AboutTopicRenderer $aboutTopicRenderer, private readonly EntityIdParser $idParser, private readonly SiteLinkLookup $siteLinkLookup, private readonly TitleFactory $titleFactory, private readonly string $siteGlobalID, private readonly EntityLookup $entityLookup...
function
public function __construct( private readonly AboutTopicRenderer $aboutTopicRenderer, private readonly EntityIdParser $idParser, private readonly SiteLinkLookup $siteLinkLookup, private readonly TitleFactory $titleFactory, private readonly string $siteGlobalID, private readonly EntityLookup $entityLookup, ...
15,509
c69e11837c3ce3934be4f3e8d7a1c99d
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=82-121/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::showContent( ?string $itemIdString )
function
private function showContent( ?string $itemIdString ): void { $out = $this->getOutput(); $itemId = $this->getItemIdParam( $itemIdString ); if ( $itemId !== null ) { $out->setProperty( 'wikibase_item', $itemId->getSerialization() ); $out->setCanonicalUrl( SpecialPage::getTitleFor( $this->getName(), $it...
15,510
8bb3daa781ec41c75d38b05092072eb0
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=130-135/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::getGroupName()
function
/** * @inheritDoc */ protected function getGroupName() { return 'other'; }
15,511
9e6aa4bc03b65a105013c350411d034c
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=137-161/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::createForm()
function
/** * Create html elements */ protected function createForm() { $form = HTMLForm::factory( 'ooui', [ 'text' => [ 'type' => 'text', 'name' => 'entityid', 'id' => 'ap-abouttopic-entityid', 'required' => true, 'cssclass' => 'ap-input', 'label-message' => 'articleplaceholder-abouttopic-ent...
15,512
1240dc66c7c6ff34380a2c6d4bbc7cb7
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=163-182/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::getItemIdParam( ?string $fallback )
function
private function getItemIdParam( ?string $fallback ): ?ItemId { $rawId = trim( $this->getRequest()->getText( 'entityid', $fallback ?? '' ) ); if ( $rawId === '' ) { return null; } try { $id = $this->idParser->parse( $rawId ); if ( !( $id instanceof ItemId ) ) { throw new EntityIdParsingException(...
15,513
156fc8940f4cf0b533c67b1792009db0
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=184-196/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::getArticleUrl( ItemId $entityId )
function
private function getArticleUrl( ItemId $entityId ): ?string { $sitelinkTitles = $this->siteLinkLookup->getLinks( [ $entityId->getNumericId() ], [ $this->siteGlobalID ] ); if ( isset( $sitelinkTitles[0][1] ) ) { $sitelinkTitle = $sitelinkTitles[0][1]; return $this->titleFactory->newFromText( $sitelink...
15,514
7f08b3b161e2329060607c3691ff4933
swh:1:cnt:02cb334e2a6925e83b9d8871f30696310e25b2e1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=198-220/
e9ad473c9722f17d9af1e8fc8c584d3c68e9fcdd
ArticlePlaceholder
deployed
includes/Specials/SpecialAboutTopic.php
SpecialAboutTopic::getRobotPolicy()
function
protected function getRobotPolicy(): string { $wikibaseItem = $this->getOutput()->getProperty( 'wikibase_item' ); if ( $wikibaseItem === null ) { // No item id set: We're showing the form, not an actual placeholder. return parent::getRobotPolicy(); } if ( $this->searchEngineIndexed === true ) { return...
15,515
3197490f2fbaa357f1a348723583da43
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=13-108/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage
type
/** * The CreateTopicPage SpecialPage for the ArticlePlaceholder extension * * @ingroup Extensions * @license GPL-2.0-or-later * @author Florian Schmidt */ class SpecialCreateTopicPage extends UnlistedSpecialPage { public function __construct( private readonly PermissionManager $permissionManager, private r...
15,516
5051bcbc15d28d770df4c4291a50b933
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=22-27/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage::__construct( private readonly PermissionManager $permissionManager, private readonly StatsFactory $statsFactory, )
function
public function __construct( private readonly PermissionManager $permissionManager, private readonly StatsFactory $statsFactory, ) { parent::__construct( 'CreateTopicPage' ); }
15,517
cbedc726f6103fabbd34d16aa432418c
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=29-63/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage::execute( $par )
function
/** * @param string|null $par */ public function execute( $par ) { $out = $this->getOutput(); $this->setHeaders(); if ( $this->getRequest()->getRawVal( 'ref' ) === 'button' ) { $this->statsFactory->getCounter( 'ArticlePlaceholder_button_createArticle_total' ) ->copyToStatsdAt( 'wikibase.articleplaceho...
15,518
cddc2decc30ff6796ab435b35d42e187
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=76-89/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage::showNoOrInvalidTitleGivenMessage( $invalid = 'missing' )
function
/** * Displays a form that gives the user the information, that the page title, he wants to * create, is invalid or none is given and that he should provide one. * * @param string $invalid */ private function showNoOrInvalidTitleGivenMessage( $invalid = 'missing' ): void { $this->showTitleInputWithMessage(...
15,519
b2878a963ef160a06ac9c99b6dec5640
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=65-74/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage::showAlreadyExistsMessage( Title $title )
function
/** * Displays a form that gives the user the information, that the page (with * the currently tried title) already exists and that he should * choose another title. */ private function showAlreadyExistsMessage( Title $title ): void { $this->showTitleInputWithMessage( $this->msg( 'articleplaceholder-creat...
15,520
838d10db4f2bd15dcfd1b76b79ef15d0
swh:1:cnt:14a5bd2b57c773147e55a91601d852b0408add9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=91-106/
cd96d1cc4bfc1f5def91e4f67d2cffe7737e2603
ArticlePlaceholder
deployed
includes/Specials/SpecialCreateTopicPage.php
SpecialCreateTopicPage::showTitleInputWithMessage( Message $msg )
function
/** * Displays a form that with the information that he should * choose another title. The given message key is used as a * reason why he need to do this. */ private function showTitleInputWithMessage( Message $msg ): void { HTMLForm::factory( 'ooui', [ 'titleinput' => [ 'type' => 'text' ] ], $this-...
15,521
f4a6609604d16122d0751d773c6c1d74
swh:1:cnt:0122b9acb59360b36a288bb7dff6b01f75df5793;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=10-18/
84c6198c81692fad18fd24fb0cd491dbb660a408
ArticlePlaceholder
deployed
modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticle.js
CreateArticleDialog
function
/** * @class */ function CreateArticleDialog() { CreateArticleDialog.super.call( this, { size: 'medium' } ); this.createContentLayout(); }
15,522
17a8cf7a98696b0e48645384f21df050
swh:1:cnt:fa986c3620db5ab9cb620baaa5ba5a4cf14ca4e3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=12-17/
9ab69135d02dede6ced16865c158729d8665041f
ArticlePlaceholder
deployed
modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.createArticleTranslation.js
CreateArticleTranslationDialog
function
/** * @class */ function CreateArticleTranslationDialog() { CreateArticleTranslationDialog.super.call( this ); }
15,523
fb919375560ea40424bf9469cc20a140
swh:1:cnt:c5a1fdbfa4d87dc52809a370e5212f8f0e1f7eb6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=10-25/
e6a9adaae9d73119183a346185a2369d65ff2e8c
ArticlePlaceholder
deployed
modules/ext.articleplaceholder.createArticle/ext.articleplaceholder.newArticle.js
init
function
function init() { var CreateArticleDialog = mw.config.get( 'apContentTranslation' ) ? module.exports.CreateArticleTranslationDialog : module.exports.CreateArticleDialog, windowManager = new OO.ui.WindowManager(), dialog = new CreateArticleDialog(); $( 'body' ).append( windowManager.$element ); wind...
15,524
cc9978981d51dce3c3a2a44b88568714
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=28-241/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest
type
/** * @covers \ArticlePlaceholder\AboutTopicRenderer * * @group ArticlePlaceholder * @group Database * * @license GPL-2.0-or-later * @author Lucie-Aimée Kaffee */ class AboutTopicRendererTest extends MediaWikiIntegrationTestCase { protected function setUp(): void { parent::setUp(); $this->insertPage( 'Te...
15,525
ff850ee8fe8942eb22e652259f60c2d6
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=39-43/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->insertPage( 'Template:AboutTopic', '(aboutTopic: {{{1}}})' ); }
15,526
7286f7bd867a6d611e12ab221ebcdd37
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=45-97/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::getInstanceOutput( ItemId $itemId, bool $canCreate = true, ?TitleFactory $titleFactory = null )
function
private function getInstanceOutput( ItemId $itemId, bool $canCreate = true, ?TitleFactory $titleFactory = null ): OutputPage { $context = new DerivativeContext( RequestContext::getMain() ); $outputPage = $context->getOutput(); $title = SpecialPage::getTitleFor( 'AboutTopic' ); $outputPage->setTitle( $tit...
15,527
7659cd184b58850e47c211fbcd7c8ab4
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=116-122/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testTemplateUsed()
function
/** * Test that the AboutTopic template has been correctly parsed */ public function testTemplateUsed() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $this->assertStringContainsString( '(aboutTopic: Q123)', $output->getHTML() ); }
15,528
f6a6174813d6ab009374c3577be77036
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=108-114/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testLanguageLinks()
function
/** * Test that Language links are set correctly */ public function testLanguageLinks() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $this->assertSame( [ 'eo:Unicorn' ], $output->getLanguageLinks() ); }
15,529
115eff0211377785dfcab328ab66efcf
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=99-106/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testTitle()
function
/** * Test that the title is set correctly */ public function testTitle() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $title = $output->getPageTitle(); $this->assertEquals( 'Label of Q123', $title ); }
15,530
e19c1f5cc05de177b3173a37769c7c47
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=124-130/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testCreateArticleButton()
function
/** * Test that the create article button has been inserted */ public function testCreateArticleButton() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $this->assertStringContainsString( 'new-article-button', $output->getHTML() ); }
15,531
7ed23368e3e1be078df7a547600e6614
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=132-138/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testCreateArticleButton_ifLabelIsNotAValidTitle()
function
public function testCreateArticleButton_ifLabelIsNotAValidTitle() { $titleFactory = $this->createMock( TitleFactory::class ); $titleFactory->method( 'newFromTextThrow' ) ->willThrowException( new MalformedTitleException( '' ) ); $html = $this->getInstanceOutput( new ItemId( 'Q123' ), true, $titleFactory )->get...
15,532
98160a9d42971f1fdca38e051eb68e21
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=140-147/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testNoCreateArticleButton_ifUserNotAllowedToCreatePage()
function
/** * Test that the create article button is not inserted, if the user is not allowed * to create the page. */ public function testNoCreateArticleButton_ifUserNotAllowedToCreatePage() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ), false ); $this->assertStringNotContainsString( 'new-article-butto...
15,533
cf7ccba9649604b64aaaa0d07a8f3f67
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=149-159/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testOtherProjectsLinks()
function
/** * Test that output properties for the other projects sidebar have been set. */ public function testOtherProjectsLinks() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $this->assertSame( 'other-projects-sidebar', $output->getProperty( 'wikibase-otherprojects-sidebar' ) ); $this->ass...
15,534
caa37600d309b58f93e24e00a57df2d6
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=161-167/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::testMetaTags()
function
public function testMetaTags() { $output = $this->getInstanceOutput( new ItemId( 'Q123' ) ); $this->assertSame( [ [ 'description', 'Description of Q123' ] ], $output->getMetaTags() ); }
15,535
03728f3bf16d9d61d3f421d1c1c449ce
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=169-181/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::getTermLookupFactory()
function
private function getTermLookupFactory(): FallbackLabelDescriptionLookupFactory { $factory = $this->createMock( FallbackLabelDescriptionLookupFactory::class ); $factory->expects( $this->once() ) ->method( 'newLabelDescriptionLookup' ) ->with( $this->getServiceContainer()->getLanguageFactory()->getLanguage(...
15,536
782abeb14cf7efca662548e7d0a51b7c
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=198-211/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::getSiteLinkLookup()
function
private function getSiteLinkLookup(): SiteLinkLookup { $siteLinkLookup = $this->createMock( SiteLinkLookup::class ); $siteLinkLookup->method( 'getSiteLinksForItem' ) ->with( new ItemId( 'Q123' ) ) ->willReturn( [ new SiteLink( 'eowiki', 'Unicorn' ), new SiteLink( 'qwertz', 'Unicorn' ), new SiteLi...
15,537
9e07313f9759328f094ccb97645fadc3
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=213-239/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::getSiteLookup()
function
private function getSiteLookup(): SiteLookup { $siteLookup = $this->createMock( SiteLookup::class ); $siteLookup->method( 'getSite' ) ->willReturnCallback( static function ( $siteId ) { $site = new Site(); $site->setGlobalId( $siteId ); switch ( $siteId ) { case 'eowiki': $site->setGroup(...
15,538
7cd13ac54b24664bd8e4ea3713b2f864
swh:1:cnt:aa492b91c063b4b8c608dd96130b7ee6ad3221b8;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=183-196/
40e0c504f4170e9f38077063cd23abbf1eebdbed
ArticlePlaceholder
deployed
tests/phpunit/includes/AboutTopicRendererTest.php
AboutTopicRendererTest::getLabelDescriptionLookup()
function
private function getLabelDescriptionLookup(): FallbackLabelDescriptionLookup { $labelDescriptionLookup = $this->createMock( FallbackLabelDescriptionLookup::class ); $labelDescriptionLookup->method( 'getLabel' ) ->willReturnCallback( static function ( ItemId $id ) { return new Term( 'eo', 'Label of ' . $id->g...
15,539
dd7307e27907e20b71338f51282ffaff
swh:1:cnt:ba3336f0d836c3f4fde3835ea4206553d4019ab0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=19-123/
9bfe66e23d2f8c9c313ceb848c9273e752cbe66f
ArticlePlaceholder
deployed
tests/phpunit/includes/ItemNotabilityFilterTest.php
ItemNotabilityFilterTest
type
/** * @group Database * @group ArticlePlaceholder * * @covers \ArticlePlaceholder\ItemNotabilityFilter * * @license GPL-2.0-or-later * @author Marius Hoch * @author Lucie-Aimée Kaffee */ class ItemNotabilityFilterTest extends MediaWikiIntegrationTestCase { /** @var ItemId[] */ private $testItemIds = []; p...
15,540
f0cdd125e1255de5c20fffc7e7e90b41
swh:1:cnt:ba3336f0d836c3f4fde3835ea4206553d4019ab0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=34-44/
9bfe66e23d2f8c9c313ceb848c9273e752cbe66f
ArticlePlaceholder
deployed
tests/phpunit/includes/ItemNotabilityFilterTest.php
ItemNotabilityFilterTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->markTestSkippedIfExtensionNotLoaded( 'WikibaseRepository' ); static $setUp = false; if ( !$setUp ) { $this->createTestEntities(); $setUp = true; } }
15,541
e20f8a33a0a2337830a29013911441e8
swh:1:cnt:ba3336f0d836c3f4fde3835ea4206553d4019ab0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=46-55/
9bfe66e23d2f8c9c313ceb848c9273e752cbe66f
ArticlePlaceholder
deployed
tests/phpunit/includes/ItemNotabilityFilterTest.php
ItemNotabilityFilterTest::getInstance()
function
private function getInstance(): ItemNotabilityFilter { $connProvider = $this->getServiceContainer()->getConnectionProvider(); return new ItemNotabilityFilter( $connProvider->getReplicaDatabase(), WikibaseRepo::getEntityNamespaceLookup(), WikibaseRepo::getStore()->newSiteLinkStore(), 'enwiki' ); }
15,542
d62323fc0b0d7a750cd2a814a024824e
swh:1:cnt:ba3336f0d836c3f4fde3835ea4206553d4019ab0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=111-121/
9bfe66e23d2f8c9c313ceb848c9273e752cbe66f
ArticlePlaceholder
deployed
tests/phpunit/includes/ItemNotabilityFilterTest.php
ItemNotabilityFilterTest::testGetNotableEntityIds()
function
public function testGetNotableEntityIds() { $itemNotabilityFilter = $this->getInstance(); $result = $itemNotabilityFilter->getNotableEntityIds( $this->testItemIds ); $this->assertEquals( [ $this->testItemIds[0] ], $result ); $this->assertCount( 1, $result ); }
15,543
ff42c85b9c42a2a1010c60cfde7035c6
swh:1:cnt:ba3336f0d836c3f4fde3835ea4206553d4019ab0;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=57-109/
9bfe66e23d2f8c9c313ceb848c9273e752cbe66f
ArticlePlaceholder
deployed
tests/phpunit/includes/ItemNotabilityFilterTest.php
ItemNotabilityFilterTest::createTestEntities()
function
private function createTestEntities() { $user = $this->getTestSysop()->getUser(); $entityStore = WikibaseRepo::getEntityStore(); $snak = new PropertyValueSnak( new NumericPropertyId( 'P123' ), new StringValue( 'foo' ) ); $statement = new Statement( $snak ); $fingerprint = new Fingerprint(); $state...
15,544
aa89ec26632fbbb5f9fc822e64db4c0a
swh:1:cnt:c04d330718f90899ac69bfefb115b23a845097e7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=7-34/
ae6f3363b55bc846bb2497113ea7be3ae7712d31
ArticlePlaceholder
deployed
tests/phpunit/includes/ScribuntoHooksTest.php
ScribuntoHooksTest
type
/** * @covers \ArticlePlaceholder\ScribuntoHooks * * @group ArticlePlaceholder * * @license GPL-2.0-or-later * @author Thiemo Kreuz */ class ScribuntoHooksTest extends \PHPUnit\Framework\TestCase { public function testOnScribuntoExternalLibraries() { $instance = new ScribuntoHooks(); $extraLibraries = []; ...
15,545
7467cdf0687f170c1f1303e95b0bdfdb
swh:1:cnt:c04d330718f90899ac69bfefb115b23a845097e7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=17-24/
ae6f3363b55bc846bb2497113ea7be3ae7712d31
ArticlePlaceholder
deployed
tests/phpunit/includes/ScribuntoHooksTest.php
ScribuntoHooksTest::testOnScribuntoExternalLibraries()
function
public function testOnScribuntoExternalLibraries() { $instance = new ScribuntoHooks(); $extraLibraries = []; $instance->onScribuntoExternalLibraries( 'lua', $extraLibraries ); $this->assertCount( 1, $extraLibraries ); $this->assertContainsOnly( 'array', $extraLibraries ); $this->assertArrayHasKey( 'class', ...
15,546
debc1fe30b8abe9cecc06b3b771d2ed9
swh:1:cnt:c04d330718f90899ac69bfefb115b23a845097e7;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=26-32/
ae6f3363b55bc846bb2497113ea7be3ae7712d31
ArticlePlaceholder
deployed
tests/phpunit/includes/ScribuntoHooksTest.php
ScribuntoHooksTest::testRegisterScribuntoExternalLibraryPaths()
function
public function testRegisterScribuntoExternalLibraryPaths() { $instance = new ScribuntoHooks(); $paths = []; $instance->onScribuntoExternalLibraryPaths( 'lua', $paths ); $this->assertArrayHasKey( 0, $paths ); $this->assertStringEndsWith( '/includes/Lua', $paths[0] ); }
15,547
4d4a8ca6ca7bfd89cbd5a5f83b9f9887
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=29-196/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest
type
/** * @group ArticlePlaceholder * * @covers \ArticlePlaceholder\SearchHookHandler * * @license GPL-2.0-or-later * @author Lucie-Aimée Kaffee */ class SearchHookHandlerTest extends MediaWikiIntegrationTestCase { private function getMockMatchingTermLookup(): MatchingTermsLookup { $typeLabel = TermIndexEntry::T...
15,548
d00759793af472be5f8c24aeb6189b06
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=39-71/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::getMockMatchingTermLookup()
function
private function getMockMatchingTermLookup(): MatchingTermsLookup { $typeLabel = TermIndexEntry::TYPE_LABEL; $typeAlias = TermIndexEntry::TYPE_ALIAS; $typeDescription = TermIndexEntry::TYPE_DESCRIPTION; return new MockMatchingTermsLookup( [ // Q7246 - Has label, description and alias all the same //...
15,549
66d53e2c33a2f1d32eeedf1b5bb43c24
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=73-88/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::getTermIndexEntry( $text, $languageCode, $termType, EntityId $entityId )
function
/** * @param string $text * @param string $languageCode * @param string $termType * @param EntityId|ItemId|NumericPropertyId $entityId * * @return TermIndexEntry */ private function getTermIndexEntry( $text, $languageCode, $termType, EntityId $entityId ): TermIndexEntry { return new TermIndexEntry( [ ...
15,550
f869d620a1e075c744e9277f85d63f5e
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=101-125/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::newSearchHookHandler( $counter, $doNotReturnTerms = false )
function
/** * @param CounterMetric $counter * @param bool $doNotReturnTerms * * @return SearchHookHandler */ protected function newSearchHookHandler( $counter, $doNotReturnTerms = false ) { $itemNotabilityFilter = $this->createMock( ItemNotabilityFilter::class ); $itemNotabilityFilter->method( 'getNotableEn...
15,551
33ac9e7fd6abab79f6fb4d8346544cd8
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=90-99/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::getMockedTermSearchInteractor( $language, $doNotReturnTerms = false )
function
private function getMockedTermSearchInteractor( $language, $doNotReturnTerms = false ): TermSearchInteractor { return new MatchingTermsLookupSearchInteractor( $this->getMockMatchingTermLookup(), new LanguageFallbackChainFactory, $doNotReturnTerms ? new NullPrefetchingTermLookup() : new FakePrefetchin...
15,552
a5dbcfec4f85c5fa1b0ac06a07f1bcb5
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=127-145/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::testNewFromGlobalState()
function
public function testNewFromGlobalState() { $config = new HashConfig( [ 'ArticlePlaceholderRepoApiUrl' => '', MainConfigNames::LanguageCode => 'en', ] ); $connectionProvider = $this->createMock( IConnectionProvider::class ); /** @var SearchHookHandler $handler */ $handler = TestingAccessWrapper::newFrom...
15,553
7fa8aa34526a4f93b73199aeb0700661
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=147-161/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::provideAddToSearch()
function
public static function provideAddToSearch() { return [ [ 'get term, check if entity with right title is returned', 'Unicorn', '>Q7246 en label</a>: Q7246 en description</div>' ], [ 'search result with no label and no description', 'Unicorn', '>Q7246</a></div>', true ], ]; }
15,554
b516da6486cbdf8481ca5796d5d29016
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=163-180/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::testAddToSearch( $message, $term, $expected, $doNotReturnTerms = false )
function
/** * @dataProvider provideAddToSearch */ public function testAddToSearch( $message, $term, $expected, $doNotReturnTerms = false ) { $output = new OutputPage( new RequestContext() ); $output->setTitle( Title::makeTitle( -1, 'Search' ) ); $counter = StatsFactory::newNull()->getCounter( 'ArticlePlaceholder_se...
15,555
64cf02e5b1f7f6680747de8938e05be1
swh:1:cnt:3d52f405e71f792a1b4323d8661c79b34c65bc6d;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=182-194/
b875ada30df947467db18c8e6e7603c899fa062b
ArticlePlaceholder
deployed
tests/phpunit/includes/SearchHookHandlerTest.php
SearchHookHandlerTest::testAddToSearch_nothingFound()
function
public function testAddToSearch_nothingFound() { $output = new OutputPage( new RequestContext() ); $output->setTitle( Title::makeTitle( -1, 'Search' ) ); $counter = StatsFactory::newNull()->getCounter( 'ArticlePlaceholder_search_total' ); $searchHookHandler = $this->newSearchHookHandler( $counter, false ); $...
15,556
fc5a65550cd0424c6c9c7b454fcb2fc9
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=15-188/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest
type
/** * @group ArticlePlaceholder * * @covers \ArticlePlaceholder\SidebarBeforeOutputHookHandler * * @license GPL-2.0-or-later * @author Marius Hoch < hoo@online.de > */ class SidebarBeforeOutputHookHandlerTest extends MediaWikiIntegrationTestCase { protected function setUp(): void { parent::setUp(); $this-...
15,557
81b9c79abfb79fa0dc346839a772226f
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=25-29/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->setUserLang( 'qqx' ); }
15,558
442d84dd86cb907de32a0b357a5776a3
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=48-64/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_wrongSpecialPageName()
function
public function testBuildSidebarLink_wrongSpecialPageName() { $title = $this->createMock( Title::class ); $title->expects( $this->once() ) ->method( 'isSpecial' ) ->willReturn( true ); // Title::getText is only called once, because we abort after checking the name $title->expects( $this->once() ) ->me...
15,559
ceb5b6d237b6a5b4b3d28009972f2c26
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=66-74/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_invalidItemId()
function
public function testBuildSidebarLink_invalidItemId() { $title = $this->getAboutTopicTitle( 'not-an-item-id' ); $skin = $this->getSkin( $title ); $result = $this->getHookHandler()->buildSidebarLink( $skin ); $this->assertFalse( $result ); }
15,560
e2d7e9562ac0dc48029a0cca911fc553
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=31-46/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_wrongNamespace()
function
public function testBuildSidebarLink_wrongNamespace() { $title = $this->createMock( Title::class ); $title->expects( $this->once() ) ->method( 'isSpecial' ) ->willReturn( false ); // We abort early, before Title::getText is ever called $title->expects( $this->never() ) ->method( 'getText' ); $skin ...
15,561
be43c9fc4f0445638583673852d69e4a
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=76-84/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_unknownItemId()
function
public function testBuildSidebarLink_unknownItemId() { $title = $this->getAboutTopicTitle( 'Q42' ); $skin = $this->getSkin( $title ); $result = $this->getHookHandler()->buildSidebarLink( $skin ); $this->assertFalse( $result ); }
15,562
0245a4463539b7511e6e88a1f20ee98b
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=86-94/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_subPage()
function
public function testBuildSidebarLink_subPage() { $title = $this->getAboutTopicTitle( 'Q2013' ); $skin = $this->getSkin( $title ); $result = $this->getHookHandler()->buildSidebarLink( $skin ); $this->assertLinkArray( $result ); }
15,563
c287c46a989a0278b8268f0bed8addf0
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=96-104/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_entityidParam()
function
public function testBuildSidebarLink_entityidParam() { $title = $this->getAboutTopicTitle(); $skin = $this->getSkin( $title, 'Q2013' ); $result = $this->getHookHandler()->buildSidebarLink( $skin ); $this->assertLinkArray( $result ); }
15,564
8da58dfe1cad93865b26956fec44c1b4
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=106-115/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::testBuildSidebarLink_entityidParamOverridesSubPage()
function
public function testBuildSidebarLink_entityidParamOverridesSubPage() { // This matches the special page's behaviour. $title = $this->getAboutTopicTitle( 'Q123' ); $skin = $this->getSkin( $title, 'Q2013' ); $result = $this->getHookHandler()->buildSidebarLink( $skin ); $this->assertLinkArray( $result ); }
15,565
24e72acb203931dfe4b480b9e3ab83a6
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=117-128/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::assertLinkArray( $result )
function
private function assertLinkArray( $result ) { $itemId = new ItemId( 'Q2013' ); $href = WikibaseClient::getRepoLinker()->getEntityUrl( $itemId ); $link = [ 'id' => 't-wikibase', 'text' => '(wikibase-dataitem)', 'href' => $href ]; $this->assertSame( $link, $result ); }
15,566
c9734162a52211bd8b51462918714b33
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=130-147/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::getAboutTopicTitle( ?string $subPage = null )
function
private function getAboutTopicTitle( ?string $subPage = null ): Title { $titleText = 'AboutTopic'; if ( $subPage ) { $titleText .= '/' . $subPage; } $title = $this->createMock( Title::class ); $title->expects( $this->once() ) ->method( 'isSpecial' ) ->willReturn( true ); $title->expects( $this->...
15,567
6a66ac52be0e4eb9937016ee857e168b
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=149-169/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::getSkin( Title $title, ?string $itemIdParam = null )
function
private function getSkin( Title $title, ?string $itemIdParam = null ): Skin { $request = $this->createMock( WebRequest::class ); $request->method( 'getVal' ) ->willReturnCallback( function ( $name, $default ) use ( $itemIdParam ) { $this->assertSame( 'entityid', $name ); return $itemIdParam ?: $default;...
15,568
16c2051d854d2377577a2211a9a72da5
swh:1:cnt:16f2aeac4e03ee26a874a2aadd079cc3f1452f9f;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=171-186/
a3b12ae9287f7b14fa121b784ec97d08c849145d
ArticlePlaceholder
deployed
tests/phpunit/includes/SidebarBeforeOutputHookHandlerTest.php
SidebarBeforeOutputHookHandlerTest::getHookHandler()
function
private function getHookHandler(): SidebarBeforeOutputHookHandler { $clientStore = new MockClientStore(); $this->setService( 'WikibaseClient.Store', $clientStore ); $mockRepository = $clientStore->getEntityRevisionLookup(); $item = new Item( new ItemId( 'Q2013' ) ); $mockRepository->putEntity( $item ); r...
15,569
d1f055d895d12e84d35613f69278ac70
swh:1:cnt:ded8ec2c647198dd9c4e35aa5f683c83918bf675;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=11-81/
3128b637d80208b46aa2c7b5d985b175aac6c274
ArticlePlaceholder
deployed
tests/phpunit/includes/TermSearchApiInteractorTest.php
TermSearchApiInteractorTest
type
/** * @covers \ArticlePlaceholder\TermSearchApiInteractor * * @group Wikibase * * @license GPL-2.0-or-later */ class TermSearchApiInteractorTest extends \PHPUnit\Framework\TestCase { private function mockApiInteractor(): RepoApiInteractor { $mock = $this->createMock( RepoApiInteractor::class ); $mock->metho...
15,570
e43f8ad0e15701e94c8f1589d3b84cd6
swh:1:cnt:ded8ec2c647198dd9c4e35aa5f683c83918bf675;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=20-61/
3128b637d80208b46aa2c7b5d985b175aac6c274
ArticlePlaceholder
deployed
tests/phpunit/includes/TermSearchApiInteractorTest.php
TermSearchApiInteractorTest::mockApiInteractor()
function
private function mockApiInteractor(): RepoApiInteractor { $mock = $this->createMock( RepoApiInteractor::class ); $mock->method( 'request' ) ->willReturnCallback( static function ( array $params ) { $result = []; $result['search'] = [ [ 'repository' => '', 'id' => 'Q294833', 'concep...
15,571
471247ddb120442f46b8858dabeeff33
swh:1:cnt:ded8ec2c647198dd9c4e35aa5f683c83918bf675;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=63-79/
3128b637d80208b46aa2c7b5d985b175aac6c274
ArticlePlaceholder
deployed
tests/phpunit/includes/TermSearchApiInteractorTest.php
TermSearchApiInteractorTest::testApiTermSearch()
function
public function testApiTermSearch() { $interactor = new TermSearchApiInteractor( $this->mockApiInteractor(), WikibaseClient::getEntityIdParser() ); $result = $interactor->searchForEntities( 'Alan', 'en', 'item', [] ); $this->assertCount( 2, $result ); $this->assertEquals( new Term( 'en', 'Alan' ), $re...
15,572
8ff80de7f56f91f9632f046271fc3d5b
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=10-85/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest
type
/** * @covers \ArticlePlaceholder\Lua\ArticlePlaceholderLibrary * * @group ArticlePlaceholder * * @license GPL-2.0-or-later * @author Thiemo Kreuz */ class ArticlePlaceholderLibraryTest extends MediaWikiIntegrationTestCase { protected function setUp(): void { parent::setUp(); $this->overrideConfigValues( ...
15,573
9379194f3929458fb4d7bef30513f0ae
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=20-27/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->overrideConfigValues( [ 'ArticlePlaceholderImageProperty' => 'P2001', 'ArticlePlaceholderReferencesBlacklist' => 'P2002', ] ); }
15,574
01314b62a2818f2ea02e502eeae7ee95
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=51-57/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::testGetReferencePropertyToHide_returnsNull()
function
public function testGetReferencePropertyToHide_returnsNull() { $this->overrideConfigValue( 'ArticlePlaceholderReferencesBlacklist', '' ); $instance = $this->newInstance(); $actual = $instance->getReferencePropertyToHide(); $this->assertNull( $actual ); }
15,575
7863dff831a3ba9a9c696106a470b341
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=29-34/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::testGetImageProperty()
function
public function testGetImageProperty() { $instance = $this->newInstance(); $actual = $instance->getImageProperty(); $this->assertSame( [ 'P2001' ], $actual ); }
15,576
384f3ed9faf1122a9329e6a4423e47f7
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=36-42/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::testGetImageProperty_throwsException()
function
public function testGetImageProperty_throwsException() { $this->overrideConfigValue( 'ArticlePlaceholderImageProperty', '' ); $instance = $this->newInstance(); $this->expectException( ConfigException::class ); $instance->getImageProperty(); }
15,577
3b790ab90e7d2661619350f8f0b63d03
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=44-49/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::testGetReferencePropertyToHide()
function
public function testGetReferencePropertyToHide() { $instance = $this->newInstance(); $actual = $instance->getReferencePropertyToHide(); $this->assertSame( [ 'P2002' ], $actual ); }
15,578
4bf7e1ee76057935455c006e3630c33e
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=59-78/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::testRegister()
function
public function testRegister() { $engine = $this->createMock( LuaEngine::class ); $engine->expects( $this->once() ) ->method( 'registerInterface' ) ->willReturnCallback( function ( $moduleFileName, array $interfaceFuncs, array $setupOptions ) { $this->assertFileExists( $moduleFileName ); ...
15,579
95575a1ef3fb1908d0eb32e005c0e7c1
swh:1:cnt:c50e59d18a6bc2c08f57c9dc68c345273c0ca1f6;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=80-83/
882c398604d197f11b0a21452f0e950c4e9b677f
ArticlePlaceholder
deployed
tests/phpunit/includes/Lua/ArticlePlaceholderLibraryTest.php
ArticlePlaceholderLibraryTest::newInstance()
function
private function newInstance(): ArticlePlaceholderLibrary { $engine = $this->createMock( LuaEngine::class ); return new ArticlePlaceholderLibrary( $engine ); }
15,580
4e7e7df7a9ef0752c18df41d12e4e1e9
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=24-150/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest
type
/** * @covers \ArticlePlaceholder\Specials\SpecialAboutTopic * * @group ArticlePlaceholder * @group Database * * @license GPL-2.0-or-later */ class SpecialAboutTopicIntegrationTest extends SpecialPageTestBase { private SpecialPage $page; private MockClientStore $store; private InMemoryEntityLookup $inMemoryL...
15,581
c2d0321cfd952749a6cbdea14b041a68
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=38-49/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->insertPage( 'Template:AboutTopic', '(aboutTopic: {{{1}}})' ); $this->store = new MockClientStore( 'sv' ); $testItem = NewItem::withId( 'Q1' )->build(); $testItem->setSiteLinkList( new SiteLinkList( [ new SiteLink( 'non-default', 'Wikipedia' ) ] ) )...
15,582
752b4ecba5986af4eaeb3905d9386646
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=51-58/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest::newSettings()
function
private function newSettings(): SettingsArray { $defaults = [ 'siteGlobalID' => 'local-non-default', 'otherProjectsLinks' => [ 'non-default' ], ]; return new SettingsArray( $defaults ); }
15,583
756b8f88e81a973a279824796f3570fe
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=116-149/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest::testExecution()
function
public function testExecution() { [ $specialPageResult, ] = $this->executeSpecialPage( 'Q1' ); $repoLinker = WikibaseClient::getRepoLinker(); $itemID = new ItemId( 'Q1' ); $entityUrl = $repoLinker->getEntityUrl( $itemID ); $expected = '<div class="mw-articleplaceholder-topmessage-container">'; $expected = ...
15,584
0be7e2bc5d60d033e701c653e530fe82
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=60-71/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest::getSiteLookupMock()
function
private function getSiteLookupMock(): SiteLookup { $sites = []; $site = new Site(); $site->setGlobalId( 'non-default' ); $site->setGroup( 'wikipedia' ); $site->setLanguageCode( 'sv' ); $site->setLinkPath( 'http://www.something-cool.se' ); $sites[] = $site; return new HashSiteStore( $sites ); }
15,585
e679984aa825e61742410f31160a3b44
swh:1:cnt:78e462c9d512f5a8c7f884c69d53ce068c7022d3;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=73-114/
629f0f8887cb8da652cb70422c3de43c447ad5f5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicIntegrationTest.php
SpecialAboutTopicIntegrationTest::newSpecialPage()
function
protected function newSpecialPage() { $services = $this->getServiceContainer(); $articlePlaceholderSearchEngineIndexed = $services->getMainConfig()->get( 'ArticlePlaceholderSearchEngineIndexed' ); $siteLookup = $this->getSiteLookupMock(); $titleFactory = $services->getTitleFactory(); $settings = $this->...
15,586
71bc53f1567dcd28d458a3b2552a19c9
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=21-185/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest
type
/** * @covers \ArticlePlaceholder\Specials\SpecialAboutTopic * * @group ArticlePlaceholder * * @license GPL-2.0-or-later * @author Thiemo Kreuz * @author Lucie-Aimée Kaffee */ class SpecialAboutTopicTest extends MediaWikiIntegrationTestCase { protected function setUp(): void { parent::setUp(); $this->set...
15,587
c1c05de5881cd0713bcd752b5e057db7
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=32-36/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::setUp()
function
protected function setUp(): void { parent::setUp(); $this->setContentLang( 'qqx' ); }
15,588
b499495a53dc6649139c11d58596f4c5
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=59-65/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::provideSearchEngineIndexed()
function
public static function provideSearchEngineIndexed() { return [ [ true ], [ false ], [ 'Q123' ] ]; }
15,589
325395e7361e30f9c3c9769ace9e84bb
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=67-80/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::testHTML( $searchEngineIndexed )
function
/** * @dataProvider provideSearchEngineIndexed */ public function testHTML( $searchEngineIndexed ) { $output = $this->getInstanceOutput( '', $searchEngineIndexed ); $this->assertSame( '(articleplaceholder-abouttopic)', $output->getPageTitle() ); $html = $output->getHTML(); $this->assertStringContainsStrin...
15,590
310b92037c7bdb45f03179ddfb75205f
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=82-86/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::testRedirect()
function
public function testRedirect() { $redirect = $this->getInstanceOutput( 'Q1234' )->getRedirect(); $this->assertSame( Title::newFromText( 'Beer' )->getLinkURL(), $redirect ); }
15,591
01d97a0b53c2565a4f0032127ac777ff
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=38-57/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::testNewFromGlobalState()
function
public function testNewFromGlobalState() { $settings = WikibaseClient::getSettings(); $siteGroup = $settings->getSetting( 'siteGroup' ); $settings->setSetting( 'siteGroup', 'wikipedia' ); $services = $this->getServiceContainer(); $this->assertInstanceOf( SpecialAboutTopic::class, SpecialAboutTopic::ne...
15,592
47a48904238d2ae5b600c91960cf702d
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=88-115/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::getInstanceOutput( string $itemIdSerialization, $searchEngineIndexed = true )
function
/** * @param string $itemIdSerialization * @param bool|string $searchEngineIndexed * * @return OutputPage */ private function getInstanceOutput( string $itemIdSerialization, $searchEngineIndexed = true ): OutputPage { $context = new DerivativeContext( RequestContext::getMain() ); $title = SpecialPage::ge...
15,593
a8aca944c12f8f0b26133b162ccf66c8
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=117-125/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::getSiteLinkLookup()
function
private function getSiteLinkLookup(): SiteLinkLookup { $siteLinkLookup = $this->createMock( SiteLinkLookup::class ); $siteLinkLookup->method( 'getLinks' ) ->with( [ 1234 ], [ 'enwiki' ] ) ->willReturn( [ [ 'enwiki', 'Beer', 1234 ] ] ); return $siteLinkLookup; }
15,594
8afc0b5810b899ecc3aa304e2cdc9ed0
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=127-135/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::getEntityIdParser()
function
private function getEntityIdParser(): EntityIdParser { $idParser = $this->createMock( EntityIdParser::class ); $idParser->method( 'parse' ) ->with( 'Q1234' ) ->willReturn( new ItemId( 'Q1234' ) ); return $idParser; }
15,595
fd8fa443dd41c0ddf9a925a108ebb9c3
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=137-147/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::getEntityLookup()
function
private function getEntityLookup(): EntityLookup { $item = new Item( new ItemId( 'Q1234' ) ); $item->setLabel( 'en', 'Beer' ); $item->setDescription( 'en', 'yummy beverage' ); $item->getSiteLinkList()->addNewSiteLink( 'enwiki', 'Beer' ); $entityLookup = new MockRepository(); $entityLookup->putEntity( $item...
15,596
f4fbd589827f9e116232b77224170c54
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=149-156/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::provideRobotPolicy()
function
public static function provideRobotPolicy() { return [ [ true, true ], [ false, false ], [ 'Q1', false ], [ 'Q2000', true ] ]; }
15,597
5903445b57802365c269c05f4753c2a7
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=158-171/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::testRobotPolicy( $searchEngineIndexed, bool $expected )
function
/** * @dataProvider provideRobotPolicy */ public function testRobotPolicy( $searchEngineIndexed, bool $expected ) { $output = $this->getInstanceOutput( 'Q1234', $searchEngineIndexed ); if ( $expected === true ) { $this->assertSame( 'index', $output->getMetadata()->getIndexPolicy() ); $this->assertSame( ...
15,598
3a2bb319ade54d593f7cffd2feebfb61
swh:1:cnt:73752c8729557d25b02591e0a4bd4f0302e14026;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=173-183/
28003db95ba16b6cd555c4dbac993c4e2b31caf5
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialAboutTopicTest.php
SpecialAboutTopicTest::testCanonicalUrl()
function
public function testCanonicalUrl() { $output = $this->getInstanceOutput( 'Q1234' ); $this->assertIsString( $output->getCanonicalUrl() ); $this->assertSame( SpecialPage::getTitleFor( 'AboutTopic', 'Q1234' )->getCanonicalURL(), $output->getCanonicalUrl() ); // Should use the sub page syntax $this->asse...
15,599
bc11771c6e50f53c0821e6ee8e45ae96
swh:1:cnt:6fd7c2974a0f9053cf1addd3978235b5b5d95eb1;origin=https://gerrit.wikimedia.org/r/mediawiki/extensions/ArticlePlaceholder.git;lines=12-57/
4fdc1a43826da582208ae1628151fa1006d7595e
ArticlePlaceholder
deployed
tests/phpunit/includes/specials/SpecialCreateTopicPageTest.php
SpecialCreateTopicPageTest
type
/** * @covers \ArticlePlaceholder\Specials\SpecialCreateTopicPage * * @group ArticlePlaceholder * @group Database * * @license GPL-2.0-or-later * @author Florian Schmidt */ class SpecialCreateTopicPageTest extends MediaWikiIntegrationTestCase { protected function setUp(): void { parent::setUp(); $this->ov...