Changeset 52010 for trunk/tests/phpunit/tests/actions.php
- Timestamp:
- 11/04/2021 03:22:47 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/actions.php
r51702 r52010 11 11 * @covers ::do_action 12 12 */ 13 function test_simple_action() {13 public function test_simple_action() { 14 14 $a = new MockAction(); 15 15 $tag = __FUNCTION__; … … 31 31 * @covers ::remove_action 32 32 */ 33 function test_remove_action() {33 public function test_remove_action() { 34 34 $a = new MockAction(); 35 35 $tag = __FUNCTION__; … … 53 53 * @covers ::has_action 54 54 */ 55 function test_has_action() {55 public function test_has_action() { 56 56 $tag = __FUNCTION__; 57 57 $func = __FUNCTION__ . '_func'; … … 72 72 * @covers ::do_action 73 73 */ 74 function test_multiple_actions() {74 public function test_multiple_actions() { 75 75 $a1 = new MockAction(); 76 76 $a2 = new MockAction(); … … 93 93 * @covers ::do_action 94 94 */ 95 function test_action_args_1() {95 public function test_action_args_1() { 96 96 $a = new MockAction(); 97 97 $tag = __FUNCTION__; … … 113 113 * @covers ::do_action 114 114 */ 115 function test_action_args_2() {115 public function test_action_args_2() { 116 116 $a1 = new MockAction(); 117 117 $a2 = new MockAction(); … … 147 147 * @covers ::do_action 148 148 */ 149 function test_action_args_3() {149 public function test_action_args_3() { 150 150 $a1 = new MockAction(); 151 151 $a2 = new MockAction(); … … 186 186 * @covers ::do_action 187 187 */ 188 function test_action_args_with_php4_syntax() {188 public function test_action_args_with_php4_syntax() { 189 189 $a = new MockAction(); 190 190 $tag = __FUNCTION__; … … 200 200 } 201 201 202 function test_action_priority() {202 public function test_action_priority() { 203 203 $a = new MockAction(); 204 204 $tag = __FUNCTION__; … … 232 232 * @covers ::did_action 233 233 */ 234 function test_did_action() {234 public function test_did_action() { 235 235 $tag1 = 'action1'; 236 236 $tag2 = 'action2'; … … 256 256 * @covers ::do_action 257 257 */ 258 function test_all_action() {258 public function test_all_action() { 259 259 $a = new MockAction(); 260 260 $tag1 = __FUNCTION__ . '_1'; … … 283 283 * @covers ::remove_action 284 284 */ 285 function test_remove_all_action() {285 public function test_remove_all_action() { 286 286 $a = new MockAction(); 287 287 $tag = __FUNCTION__; … … 306 306 * @covers ::do_action_ref_array 307 307 */ 308 function test_action_ref_array() {308 public function test_action_ref_array() { 309 309 $obj = new stdClass(); 310 310 $a = new MockAction(); … … 327 327 * @covers ::do_action 328 328 */ 329 function test_action_keyed_array() {329 public function test_action_keyed_array() { 330 330 $a = new MockAction(); 331 331 … … 354 354 * @covers ::remove_action 355 355 */ 356 function test_action_self_removal() {356 public function test_action_self_removal() { 357 357 add_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) ); 358 358 do_action( 'test_action_self_removal' ); … … 360 360 } 361 361 362 function action_self_removal() {362 public function action_self_removal() { 363 363 remove_action( 'test_action_self_removal', array( $this, 'action_self_removal' ) ); 364 364 } … … 369 369 * @covers ::do_action 370 370 */ 371 function test_action_recursion() {371 public function test_action_recursion() { 372 372 $tag = __FUNCTION__; 373 373 $a = new MockAction(); … … 386 386 * @covers ::do_action 387 387 */ 388 function action_that_causes_recursion( $tag ) {388 public function action_that_causes_recursion( $tag ) { 389 389 static $recursing = false; 390 390 if ( ! $recursing ) { … … 402 402 * @covers ::add_action 403 403 */ 404 function test_action_callback_manipulation_while_running() {404 public function test_action_callback_manipulation_while_running() { 405 405 $tag = __FUNCTION__; 406 406 $a = new MockAction(); … … 424 424 } 425 425 426 function action_that_manipulates_a_running_hook( $tag, $mocks ) {426 public function action_that_manipulates_a_running_hook( $tag, $mocks ) { 427 427 remove_action( $tag, array( $mocks[1], 'action' ), 12, 2 ); 428 428 add_action( $tag, array( $mocks[2], 'action' ), 12, 2 ); … … 439 439 * @covers ::remove_filter 440 440 */ 441 function test_remove_anonymous_callback() {441 public function test_remove_anonymous_callback() { 442 442 $tag = __FUNCTION__; 443 443 $a = new MockAction(); … … 476 476 * @covers WP_Hook::offsetUnset 477 477 */ 478 function test_array_access_of_wp_filter_global() {478 public function test_array_access_of_wp_filter_global() { 479 479 global $wp_filter; 480 480 $tag = __FUNCTION__; … … 504 504 * @covers ::current_action 505 505 */ 506 function test_current_action() {506 public function test_current_action() { 507 507 global $wp_current_filter; 508 508 $wp_current_filter[] = 'first'; … … 517 517 * @covers ::doing_filter 518 518 */ 519 function test_doing_filter() {519 public function test_doing_filter() { 520 520 global $wp_current_filter; 521 521 $wp_current_filter = array(); // Set to an empty array first. … … 538 538 * @covers ::doing_filter 539 539 */ 540 function test_doing_action() {540 public function test_doing_action() { 541 541 global $wp_current_filter; 542 542 $wp_current_filter = array(); // Set to an empty array first. … … 559 559 * @covers ::doing_filter 560 560 */ 561 function test_doing_filter_real() {561 public function test_doing_filter_real() { 562 562 $this->assertFalse( doing_filter() ); // No filter is passed in, and no filter is being processed. 563 563 $this->assertFalse( doing_filter( 'testing' ) ); // Filter is passed in but not being processed. … … 576 576 } 577 577 578 function apply_testing_filter() {578 public function apply_testing_filter() { 579 579 $this->apply_testing_filter = true; 580 580 … … 597 597 } 598 598 599 function apply_testing_nested_filter() {599 public function apply_testing_nested_filter() { 600 600 $this->apply_testing_nested_filter = true; 601 601 $this->assertTrue( doing_filter() );
Note: See TracChangeset
for help on using the changeset viewer.