Skip to content

Instantly share code, notes, and snippets.

@eriktorsner
Last active April 25, 2017 10:13
Show Gist options
  • Save eriktorsner/572c6ae3df8c1b231c89bb17c579e647 to your computer and use it in GitHub Desktop.
Save eriktorsner/572c6ae3df8c1b231c89bb17c579e647 to your computer and use it in GitHub Desktop.
Snippet from helloTestableTest.php
<?php
public function testEchoCss()
{
\WP_Mock::userFunction('is_rtl', array(
'return_in_order' => array(true, false),
));
$dummy = new \stdClass();
$hello = new helloTestable($dummy);
$this->expectOutputRegex('/.*float: left*./');
$hello->echoCss();
$this->expectOutputRegex('/.*float: right*./');
$hello->echoCss();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment