Example #1
0
 /**
  * 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 '';
 }
Example #2
0
 /**
  * @param String $message
  * @param String $input
  * @param String $expected
  *
  * @dataProvider removeWikitextFromLyricsDataProvider
  */
 public function testRemoveWikitextFromLyrics($message, $input, $expected)
 {
     $this->assertEquals($expected, LyricsUtils::removeWikitextFromLyrics($input), $message);
 }