Make WordPress Core

Changeset 25 in tests for wp-testlib/utils.php


Ignore:
Timestamp:
09/22/2007 11:45:08 PM (19 years ago)
Author:
tellyworth
Message:

add test_actions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wp-testlib/utils.php

    r24 r25  
    3838                $args = func_get_args();
    3939                $current_action = $wp_actions[count($wp_actions)-1];
    40                 $this->events[] = array('tag'=>$current_action, 'args'=>$args);
     40                $this->events[] = array('action' => __FUNCTION__, 'tag'=>$current_action, 'args'=>$args);
     41        }
     42
     43        function action2() {
     44                global $wp_actions;
     45
     46                $args = func_get_args();
     47                $current_action = $wp_actions[count($wp_actions)-1];
     48                $this->events[] = array('action' => __FUNCTION__, 'tag'=>$current_action, 'args'=>$args);
     49        }
     50       
     51        // return a list of all the actions, tags and args
     52        function get_events() {
     53                return $this->events;
    4154        }
    4255
    … …  
    5669        function get_tags() {
    5770                $out = array();
    58                 foreach ($this->events as $e)
     71                foreach ($this->events as $e) {
    5972                        $out[] = $e['tag'];
     73                }
    6074                return $out;
    6175        }
Note: See TracChangeset for help on using the changeset viewer.