WordPress.org

Make WordPress Core

Changeset 935 in tests


Ignore:
Timestamp:
07/21/2012 08:23:34 PM (6 years ago)
Author:
nacin
Message:

Add an explicit test for self-removal of actions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/actions.php

    r909 r935  
    242242    }
    243243
     244    function test_action_self_removal() {
     245        add_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
     246        do_action( 'test_action_self_removal' );
     247        $this->assertEquals( 1, did_action( 'test_action_self_removal' ) );
     248    }
     249
     250    function action_self_removal() {
     251        remove_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) );
     252    }
    244253}
Note: See TracChangeset for help on using the changeset viewer.