Make WordPress Core

Ticket #36786: 36786.patch

File 36786.patch, 777 bytes (added by dlh, 8 years ago)
  • tests/phpunit/includes/utils.php

     
    108108                return $this->events;
    109109        }
    110110
    111         // return a count of the number of times the action was called since the last reset
     111        // Return a count of the number of times an action or filter was called since the last reset.
    112112        function get_call_count($tag='') {
    113113                if ($tag) {
    114114                        $count = 0;
    115115                        foreach ($this->events as $e)
    116                                 if ($e['action'] == $tag)
     116                                if ( ( isset( $e['action'] ) && $e['action'] == $tag ) || ( isset( $e['filter'] ) && $e['filter'] == $tag ) ) {
    117117                                        ++$count;
     118                                }
    118119                        return $count;
    119120                }
    120121                return count($this->events);