/** * Get song lyrics from article * * @param $article * @return string */ protected function getLyrics($article) { if (preg_match('#<lyrics>(.*?)<\\/lyrics>#s', $article->getContent(), $matches)) { return LyricsUtils::removeWikitextFromLyrics($matches[1]); } return ''; }
/** * @param String $message * @param String $input * @param String $expected * * @dataProvider removeWikitextFromLyricsDataProvider */ public function testRemoveWikitextFromLyrics($message, $input, $expected) { $this->assertEquals($expected, LyricsUtils::removeWikitextFromLyrics($input), $message); }