Created
April 22, 2020 12:08
-
-
Save nb/69c425d343ef655d75cf75d0b4d2b5d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Test_Did_Action extends WP_UnitTestCase { | |
public function test_did_action_should_be_two_if_action_fired_twice() { | |
do_action( 'wink' ); | |
do_action( 'wink' ); | |
$this->assertEquals( 2, did_action( 'wink' ) ); | |
} | |
public function test_did_action_should_be_one_if_action_fired_once() { | |
do_action( 'wink' ); | |
$this->assertEquals( 1, did_action( 'wink' ) ); | |
} | |
public function test_did_action_should_be_zero_if_no_action_fired() { | |
$this->assertEquals( 0, did_action( 'wink' ) ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment