setupFile = dirname( __FILE__ ) . '/../PortableInfobox.setup.php'; parent::setUp(); } /** * @dataProvider testsProvider */ public function testInfoboxParsing( $markup, $expected ) { $helper = $this->getMockBuilder( 'Wikia\PortableInfobox\Helpers\PortableInfoboxTemplatesHelper' ) ->setMethods( [ 'fetchContent' ] )->getMock(); $helper->expects( $this->once() )->method( 'fetchContent' )->will( $this->returnValue( $markup ) ); $result = $helper->parseInfoboxes( new Title() ); $this->assertEquals( $expected, $result ); } public function testsProvider() { return [ [ 'test', false ], [ '', [ [ 'data' => [ ], 'sources' => [ 'test' ] ] ] ], [ '', false ], [ ' ', [ [ 'data' => [ ], 'sources' => [ ] ] ] ], [ '', false ], [ '', false ], ]; } }