Skip to content

Instantly share code, notes, and snippets.

@eriktorsner
Last active April 25, 2017 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eriktorsner/77377eaaf4538237d607a9815a0c0fd0 to your computer and use it in GitHub Desktop.
Save eriktorsner/77377eaaf4538237d607a9815a0c0fd0 to your computer and use it in GitHub Desktop.
Snippet from LyricsTest.php
<?php
public function testGetLyric()
{
$file = dirname(__DIR__) . '/fixtures/lyrics.txt';
$lyrics = new Lyrics($file);
\WP_Mock::userFunction('wptexturize', array(
'return' => function($s) {
return $s . ' wptexturize';
}
));
$line = $lyrics->getLyric();
$parts = explode(' ', $line);
$this->assertEquals('line', $parts[0]);
$this->assertEquals('wptexturize', $parts[2]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment