WordPress.org

Make WordPress Core

Ticket #28486: 28486.2.diff

File 28486.2.diff, 1.1 KB (added by prasoon2211, 6 years ago)

Version 2

  • tests/phpunit/includes/testcase.php

     
    245245                }
    246246        }
    247247
     248        function setExpectedDeprecated( $deprecated_element ) {
     249                array_push( $this->expected_deprecated, $deprecated_element );
     250        }
     251
     252        function setExpectedIncorrectUsage( $doing_it_wrong ) {
     253                array_push( $this->expected_doing_it_wrong, $doing_it_wrong );
     254        }
     255
    248256        function deprecated_function_run( $function ) {
    249257                if ( ! in_array( $function, $this->caught_deprecated ) )
    250258                        $this->caught_deprecated[] = $function;
  • tests/phpunit/tests/includes/helpers.php

     
    168168
    169169                $this->assertFalse( isset( $stati['foo'] ) );
    170170        }
     171
     172        public function test_setExpectedDeprecated() {
     173                _deprecated_function( __FUNCTION__, '2.5' );
     174                $this->setExpectedDeprecated( 'test_setExpectedDeprecated' );
     175        }
    171176}