Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Created June 19, 2015 17:53
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 sirbrillig/8068dc2483f00a310291 to your computer and use it in GitHub Desktop.
Save sirbrillig/8068dc2483f00a310291 to your computer and use it in GitHub Desktop.
WP_Mock do_action failure
{
"require-dev": {
"10up/wp_mock": "dev-master"
}
}
<?php
function my_wp_function() {
do_action( 'foo', 'bar' );
}
class MyTest extends PHPUnit_Framework_TestCase
{
public function setUp() {
\WP_Mock::setUp();
}
public function tearDown() {
\WP_Mock::tearDown();
}
public function testRunsCorrectly()
{
my_wp_function();
$this->assertEquals(1, 1);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment