Instantly share code, notes, and snippets.

Embed
What would you like to do?
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