WordPress.org

Make WordPress Core

Changeset 301 in tests


Ignore:
Timestamp:
05/16/10 13:38:57 (4 years ago)
Author:
westi
Message:

Add a test for closures without arguments too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_actions.php

    r299 r301  
    275275         
    276276        $this->assertSame($GLOBALS[$context[0]], $context[1]); 
     277         
     278        $tag2 = rand_str(); 
     279        $closure2 = function() { $GLOBALS['closure_no_args'] = true;}; 
     280        add_action($tag2, $closure2); 
     281 
     282        $this->assertSame( 10, has_action($tag2, $closure2) ); 
     283         
     284        do_action($tag2); 
     285         
     286        $this->assertTrue($GLOBALS['closure_no_args']); 
     287         
    277288    } 
    278289 
Note: See TracChangeset for help on using the changeset viewer.