mediawiki-extensions-Discus.../includes/ServiceWiring.php
Dreamy Jazz 68ae9555f1 Test ServiceWiring.php
Test ServiceWiring.php using tests copied from CentralAuth. Because
phpunit does not support marking a file as covered, the ServiceWiring
file is ignored for code coverage as the tests fully cover the file.

Change-Id: I7da8d74fec84a5aa9c77bc0678ad8f55b550893a
2023-01-13 12:01:38 +00:00

58 lines
1.8 KiB
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools;
use MediaWiki\MediaWikiServices;
// PHP unit does not understand code coverage for this file
// as the @covers annotation cannot cover a specific file
// This is fully tested in ServiceWiringTest.php
// @codeCoverageIgnoreStart
return [
'DiscussionTools.CommentParser' => static function ( MediaWikiServices $services ): CommentParser {
return new CommentParser(
$services->getMainConfig(),
$services->getContentLanguage(),
$services->getLanguageConverterFactory(),
$services->getService( 'DiscussionTools.LanguageData' ),
$services->getTitleParser()
);
},
'DiscussionTools.LanguageData' => static function ( MediaWikiServices $services ): LanguageData {
return new LanguageData(
$services->getMainConfig(),
$services->getContentLanguage(),
$services->getLanguageConverterFactory(),
$services->getSpecialPageFactory()
);
},
'DiscussionTools.SubscriptionStore' => static function ( MediaWikiServices $services ): SubscriptionStore {
return new SubscriptionStore(
$services->getConfigFactory(),
$services->getDBLoadBalancerFactory(),
$services->getReadOnlyMode(),
$services->getUserFactory()
);
},
'DiscussionTools.ThreadItemStore' => static function ( MediaWikiServices $services ): ThreadItemStore {
return new ThreadItemStore(
$services->getConfigFactory(),
$services->getDBLoadBalancerFactory(),
$services->getReadOnlyMode(),
$services->getPageStore(),
$services->getRevisionStore(),
$services->getTitleFormatter(),
$services->getActorStore()
);
},
'DiscussionTools.ThreadItemFormatter' => static function ( MediaWikiServices $services ): ThreadItemFormatter {
return new ThreadItemFormatter(
$services->getTitleFormatter(),
$services->getLinkRenderer()
);
},
];
// @codeCoverageIgnoreEnd