Skip to content

Commit c66742e

Browse files
committed
Use Title::class in ParserFunctionFactoryTest mock
Replace string-based '\Title' mock with Title::class and drop getNamespace expectation as test uses real Title objects.
1 parent 2c56e7f commit c66742e

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

tests/phpunit/Unit/ParserFunctionFactoryTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@ class ParserFunctionFactoryTest extends \PHPUnit\Framework\TestCase {
2323
protected function setUp() : void {
2424
parent::setUp();
2525

26-
$title = $this->getMockBuilder( '\Title' )
26+
$title = $this->getMockBuilder( Title::class )
2727
->disableOriginalConstructor()
28+
->onlyMethods( [] )
2829
->getMock();
2930

30-
$title->expects( $this->any() )
31-
->method( 'getNamespace' )
32-
->will( $this->returnValue( NS_MAIN ) );
33-
34-
$parserOutput = $this->getMockBuilder( '\ParserOutput' )
31+
$parserOutput = $this->getMockBuilder( \MediaWiki\Parser\ParserOutput::class )
3532
->disableOriginalConstructor()
3633
->getMock();
3734

38-
$this->parser = $this->getMockBuilder( '\Parser' )
35+
$this->parser = $this->getMockBuilder( Parser::class )
3936
->disableOriginalConstructor()
4037
->getMock();
4138

0 commit comments

Comments
 (0)