Make WordPress Core

Changeset 407 in tests for wp-testcase/test_actions.php


Ignore:
Timestamp:
08/04/2011 08:38:26 PM (15 years ago)
Author:
ryan
Message:

Pinking shears

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testcase/test_actions.php

    r301 r407  
    3939
    4040        }
    41        
     41
    4242        function test_has_action() {
    4343                        $tag = rand_str();
    4444                        $func = rand_str();
    45                        
     45
    4646                        $this->assertFalse( has_action($tag, $func) );
    4747                        $this->assertFalse( has_action($tag) );
     
    202202                $a = new MockAction();
    203203                $tags = array(rand_str(), rand_str(), rand_str(), rand_str(), rand_str());
    204                
     204
    205205                // two actions per tag
    206206                foreach ($tags as $tag) {
     
    238238                $this->assertFalse( empty($args[0][0]->foo) );
    239239        }
    240        
     240
    241241        function test_action_keyed_array() {
    242242                $this->knownWPBug(11241);
     
    246246
    247247                add_action($tag, array(&$a, 'action'));
    248                
     248
    249249                $context = array( rand_str() => rand_str() );
    250250                do_action($tag, $context);
     
    258258                $args = $a->get_args();
    259259                $this->assertSame($args[1][0], $context2);
    260                
     260
    261261        }
    262262
     
    270270
    271271                $this->assertSame( 10, has_action($tag, $closure) );
    272                
     272
    273273                $context = array( rand_str(), rand_str() );
    274274                do_action($tag, $context[0], $context[1]);
    275                
     275
    276276                $this->assertSame($GLOBALS[$context[0]], $context[1]);
    277                
     277
    278278                $tag2 = rand_str();
    279279                $closure2 = function() { $GLOBALS['closure_no_args'] = true;};
     
    281281
    282282                $this->assertSame( 10, has_action($tag2, $closure2) );
    283                
     283
    284284                do_action($tag2);
    285                
     285
    286286                $this->assertTrue($GLOBALS['closure_no_args']);
    287                
     287
    288288        }
    289289
Note: See TracChangeset for help on using the changeset viewer.