Changeset 52009 for trunk/tests/phpunit/includes/utils.php
- Timestamp:
- 11/04/2021 01:15:33 PM (4 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/includes/utils.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/utils.php
r51552 r52009 65 65 * PHP5 constructor. 66 66 */ 67 function __construct( $debug = 0 ) {67 public function __construct( $debug = 0 ) { 68 68 $this->reset(); 69 69 $this->debug = $debug; 70 70 } 71 71 72 function reset() {72 public function reset() { 73 73 $this->events = array(); 74 74 } 75 75 76 function current_filter() {76 public function current_filter() { 77 77 if ( is_callable( 'current_filter' ) ) { 78 78 return current_filter(); … … 82 82 } 83 83 84 function action( $arg ) {84 public function action( $arg ) { 85 85 if ( $this->debug ) { 86 86 dmp( __FUNCTION__, $this->current_filter() ); … … 95 95 } 96 96 97 function action2( $arg ) {97 public function action2( $arg ) { 98 98 if ( $this->debug ) { 99 99 dmp( __FUNCTION__, $this->current_filter() ); … … 109 109 } 110 110 111 function filter( $arg ) {111 public function filter( $arg ) { 112 112 if ( $this->debug ) { 113 113 dmp( __FUNCTION__, $this->current_filter() ); … … 123 123 } 124 124 125 function filter2( $arg ) {125 public function filter2( $arg ) { 126 126 if ( $this->debug ) { 127 127 dmp( __FUNCTION__, $this->current_filter() ); … … 137 137 } 138 138 139 function filter_append( $arg ) {139 public function filter_append( $arg ) { 140 140 if ( $this->debug ) { 141 141 dmp( __FUNCTION__, $this->current_filter() ); … … 151 151 } 152 152 153 function filterall( $tag, ...$args ) {153 public function filterall( $tag, ...$args ) { 154 154 // This one doesn't return the result, so it's safe to use with the new 'all' filter. 155 155 if ( $this->debug ) { … … 165 165 166 166 // Return a list of all the actions, tags and args. 167 function get_events() {167 public function get_events() { 168 168 return $this->events; 169 169 } 170 170 171 171 // Return a count of the number of times the action was called since the last reset. 172 function get_call_count( $tag = '' ) {172 public function get_call_count( $tag = '' ) { 173 173 if ( $tag ) { 174 174 $count = 0; … … 184 184 185 185 // Return an array of the tags that triggered calls to this action. 186 function get_tags() {186 public function get_tags() { 187 187 $out = array(); 188 188 foreach ( $this->events as $e ) { … … 193 193 194 194 // Return an array of args passed in calls to this action. 195 function get_args() {195 public function get_args() { 196 196 $out = array(); 197 197 foreach ( $this->events as $e ) { … … 211 211 * PHP5 constructor. 212 212 */ 213 function __construct( $in ) {213 public function __construct( $in ) { 214 214 $this->xml = xml_parser_create(); 215 215 xml_set_object( $this->xml, $this ); … … 220 220 } 221 221 222 function parse( $in ) {222 public function parse( $in ) { 223 223 $parse = xml_parse( $this->xml, $in, true ); 224 224 if ( ! $parse ) { … … 236 236 } 237 237 238 function start_handler( $parser, $name, $attributes ) {238 public function start_handler( $parser, $name, $attributes ) { 239 239 $data['name'] = $name; 240 240 if ( $attributes ) { … … 243 243 } 244 244 245 function data_handler( $parser, $data ) {245 public function data_handler( $parser, $data ) { 246 246 $index = count( $this->data ) - 1; 247 247 … … 252 252 } 253 253 254 function end_handler( $parser, $name ) {254 public function end_handler( $parser, $name ) { 255 255 if ( count( $this->data ) > 1 ) { 256 256 $data = array_pop( $this->data );
Note: See TracChangeset
for help on using the changeset viewer.