WordPress.org

Make WordPress Core

Changeset 935 in tests


Ignore:
Timestamp:
07/21/12 20:23:34 (21 months 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.