Merge "preprocessDump.php: Fix invalid Preprocessor instantiation"
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / ParserFactoryTest.php
1 <?php
2
3 /**
4 * @covers ParserFactory
5 */
6 class ParserFactoryTest extends MediaWikiIntegrationTestCase {
7 use FactoryArgTestTrait;
8
9 protected static function getFactoryClass() {
10 return ParserFactory::class;
11 }
12
13 protected static function getInstanceClass() {
14 return Parser::class;
15 }
16
17 protected static function getFactoryMethodName() {
18 return 'create';
19 }
20
21 protected static function getExtraClassArgCount() {
22 // The parser factory itself is passed to the parser
23 return 1;
24 }
25
26 protected function getOverriddenMockValueForParam( ReflectionParameter $param ) {
27 if ( $param->getPosition() === 0 ) {
28 return [ $this->createMock( MediaWiki\Config\ServiceOptions::class ) ];
29 }
30 return [];
31 }
32 }