Skip to content

Commit

Permalink
Avoid "Use of old calling convention for Parser::__construct was depr…
Browse files Browse the repository at this point in the history
…ecated ..." (#94)
  • Loading branch information
mwjames committed May 16, 2020
1 parent b43b74c commit 8ca9d1e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
26 changes: 23 additions & 3 deletions tests/phpunit/Unit/ParserFunctionFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,29 @@ class ParserFunctionFactoryTest extends \PHPUnit_Framework_TestCase {
protected function setUp() : void {
parent::setUp();

$this->parser = new Parser();
$this->parser->Options( new ParserOptions() );
$this->parser->clearState();
$title = $this->getMockBuilder( '\Title' )
->disableOriginalConstructor()
->getMock();

$title->expects( $this->any() )
->method( 'getNamespace' )
->will( $this->returnValue( NS_MAIN ) );

$parserOutput = $this->getMockBuilder( '\ParserOutput' )
->disableOriginalConstructor()
->getMock();

$this->parser = $this->getMockBuilder( '\Parser' )
->disableOriginalConstructor()
->getMock();

$this->parser->expects( $this->any() )
->method( 'getTitle' )
->will( $this->returnValue( $title ) );

$this->parser->expects( $this->any() )
->method( 'getOutput' )
->will( $this->returnValue( $parserOutput ) );
}

public function testCanConstruct() {
Expand Down
10 changes: 0 additions & 10 deletions tests/phpunit/Unit/PreTextFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ class PreTextFormatterTest extends \PHPUnit_Framework_TestCase {

const LF = "\n";

private $parser;

protected function setUp() : void {
parent::setUp();

$this->parser = new Parser();
$this->parser->Options( new ParserOptions() );
$this->parser->clearState();
}

public function testCanConstruct() {

$this->assertInstanceOf(
Expand Down

0 comments on commit 8ca9d1e

Please sign in to comment.