Changeset 37909 for trunk/tests/phpunit/tests/actions.php
- Timestamp:
- 06/29/2016 01:13:53 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/actions.php
r37861 r37909 365 365 366 366 $wp_actions = array(); 367 367 368 368 $this->assertEmpty( $wp_actions ); 369 369 _restore_plugin_globals(); … … 384 384 $tag = rand_str(); 385 385 add_action($tag, array(&$a, 'action')); 386 386 387 387 $this->assertNotEquals( $GLOBALS['wp_filter'], $original_filter ); 388 388 … … 459 459 $p2->post_title = 'Bar2'; 460 460 } 461 462 /**463 * @ticket 10441464 * @expectedDeprecated tests_apply_filters_deprecated465 */466 public function test_apply_filters_deprecated() {467 $p = 'Foo';468 469 add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) );470 $p = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p ), '4.6' );471 remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) );472 473 $this->assertSame( 'Bar', $p );474 }475 476 public static function deprecated_filter_callback( $p ) {477 $p = 'Bar';478 return $p;479 }480 481 /**482 * @ticket 10441483 * @expectedDeprecated tests_apply_filters_deprecated484 */485 public function test_apply_filters_deprecated_with_multiple_params() {486 $p1 = 'Foo1';487 $p2 = 'Foo2';488 489 add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 );490 $p1 = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p1, $p2 ), '4.6' );491 remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 );492 493 $this->assertSame( 'Bar1', $p1 );494 495 // Not passed by reference, so not modified.496 $this->assertSame( 'Foo2', $p2 );497 }498 499 public static function deprecated_filter_callback_multiple_params( $p1, $p2 ) {500 $p1 = 'Bar1';501 $p2 = 'Bar2';502 503 return $p1;504 }505 461 }
Note: See TracChangeset
for help on using the changeset viewer.