getMockBuilder( PortableInfoboxParsingHelper::class )
->setMethods( [ 'fetchArticleContent' ] )
->getMock();
$helper->expects( $this->once() )
->method( 'fetchArticleContent' )
->will( $this->returnValue( $markup ) );
$result = $helper->parseIncludeonlyInfoboxes( $this->getExistingTestPage( 'Test' )->getTitle() );
$this->assertEquals( $expected, $result );
}
public function parsingIncludeonlyInfoboxesDataProvider() {
return [
[ 'test', false ],
[
'',
[
[
'parser_tag_version' => PortableInfoboxParserTagController::PARSER_TAG_VERSION,
'data' => [],
'metadata' => [
[
'type' => 'data',
'sources' => [
'test' => [
'label' => '1',
'primary' => true
]
]
]
]
]
]
],
[ '', false ],
[ '', false ],
[
'',
[
[
'parser_tag_version' => PortableInfoboxParserTagController::PARSER_TAG_VERSION,
'data' => [],
'metadata' => []
]
]
],
[ '', false ],
[ '', false ],
];
}
}