getMockBuilder( \Wikia\PortableInfobox\Helpers\PortableInfoboxParsingHelper::class ) ->setMethods( [ 'fetchArticleContent' ] ) ->getMock(); $helper->expects( $this->once() ) ->method( 'fetchArticleContent' ) ->willReturn( $markup ); $result = $helper->parseIncludeonlyInfoboxes( new Title() ); $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 ], [ ' ', [ [ 'parser_tag_version' => PortableInfoboxParserTagController::PARSER_TAG_VERSION, 'data' => [], 'metadata' => [] ] ] ], [ '', false ], [ '', false ], ]; } }