Make WordPress Core

Ticket #48255: 48255-deprecated-hooks-tests-use-x.x.x-style-version-nrs.patch

File 48255-deprecated-hooks-tests-use-x.x.x-style-version-nrs.patch, 3.3 KB (added by jrf, 5 years ago)

[Tests] Deprecated hooks: use x.x.x style version numbers

  • tests/phpunit/tests/actions.php

    From daa1e84d9fddb06665948d6ae68a1cf3064b20f8 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Tue, 8 Oct 2019 03:27:31 +0200
    Subject: [PATCH] [Tests] Deprecated hooks: use x.x.x style version numbers
    
    ---
     tests/phpunit/tests/actions.php | 4 ++--
     tests/phpunit/tests/filters.php | 6 +++---
     2 files changed, 5 insertions(+), 5 deletions(-)
    
    diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php
    index d23e6a63b2..7238d5560e 100644
    a b class Tests_Actions extends WP_UnitTestCase { 
    527527                $p = new WP_Post( (object) array( 'post_title' => 'Foo' ) );
    528528
    529529                add_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback' ) );
    530                 do_action_deprecated( 'tests_do_action_deprecated', array( $p ), '4.6' );
     530                do_action_deprecated( 'tests_do_action_deprecated', array( $p ), '4.6.0' );
    531531                remove_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback' ) );
    532532
    533533                $this->assertSame( 'Bar', $p->post_title );
    class Tests_Actions extends WP_UnitTestCase { 
    546546                $p2 = new WP_Post( (object) array( 'post_title' => 'Foo2' ) );
    547547
    548548                add_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback_multiple_params' ), 10, 2 );
    549                 do_action_deprecated( 'tests_do_action_deprecated', array( $p1, $p2 ), '4.6' );
     549                do_action_deprecated( 'tests_do_action_deprecated', array( $p1, $p2 ), '4.6.0' );
    550550                remove_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback_multiple_params' ), 10, 2 );
    551551
    552552                $this->assertSame( 'Bar1', $p1->post_title );
  • tests/phpunit/tests/filters.php

    diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php
    index 03af7e56ce..2060fe1c73 100644
    a b class Tests_Filters extends WP_UnitTestCase { 
    303303                $p = 'Foo';
    304304
    305305                add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) );
    306                 $p = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p ), '4.6' );
     306                $p = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p ), '4.6.0' );
    307307                remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) );
    308308
    309309                $this->assertSame( 'Bar', $p );
    class Tests_Filters extends WP_UnitTestCase { 
    323323                $p2 = 'Foo2';
    324324
    325325                add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 );
    326                 $p1 = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p1, $p2 ), '4.6' );
     326                $p1 = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p1, $p2 ), '4.6.0' );
    327327                remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 );
    328328
    329329                $this->assertSame( 'Bar1', $p1 );
    class Tests_Filters extends WP_UnitTestCase { 
    345345        public function test_apply_filters_deprecated_without_filter() {
    346346                $val = 'Foobar';
    347347
    348                 $this->assertSame( $val, apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $val ), '4.6' ) );
     348                $this->assertSame( $val, apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $val ), '4.6.0' ) );
    349349        }
    350350
    351351        private $current_priority;