Make WordPress Core


Ignore:
Timestamp:
11/07/2025 11:38:10 PM (3 months ago)
Author:
SergeyBiryukov
Message:

Tests: Improve unit tests for feed_links_extra().

Includes:

  • Converting data provider methods to static for a slight performance improvement.
  • Correcting annotations for consistency.

Follow-up to [53033], [53125], [54161].

Props mukesh27, SergeyBiryukov.
See #63167.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/general/feedLinksExtra.php

    r61056 r61185  
    22/**
    33 * Test feed_links_extra().
    4  *
    5  * @ticket 54713
    64 *
    75 * @group general
     
    165163
    166164    /**
     165     * @ticket 54713
     166     *
    167167     * @dataProvider data_feed_links_extra
    168      * @ticket 54713
    169      *
    170      * @param string $title     The expected title.
    171      * @param string $type      The name of the test class property containing the object ID.
    172      * @param array  $args {
     168     *
     169     * @param string $title The expected title.
     170     * @param string $type  The name of the test class property containing the object ID.
     171     * @param array  $args  {
    173172     *        Optional arguments. Default empty.
    174173     *
     
    211210     * @return array
    212211     */
    213     public function data_feed_links_extra() {
     212    public static function data_feed_links_extra() {
    214213        return array(
    215214            'a post with a comment'                        => array(
     
    400399    /**
    401400     * Helper function to get the permalink based on type.
    402      *
    403      * @ticket 54713
    404401     *
    405402     * @param string $type The name of the test class property containing the object ID.
     
    523520
    524521    /**
     522     * @ticket 54703
     523     *
    525524     * @dataProvider data_feed_links_extra_should_output_nothing_when_post_comments_feed_link_is_falsy
    526      *
    527      * @ticket 54703
    528525     *
    529526     * @param string $callback The callback to use for the 'post_comments_feed_link' filter.
     
    582579
    583580    /**
     581     * @ticket 55904
     582     *
    584583     * @dataProvider data_feed_links_extra_should_output_nothing_when_filters_return_false
    585      *
    586      * @ticket 55904
    587584     *
    588585     * @param string $type   The name of the test class property containing the object ID.
     
    603600     * @return array
    604601     */
    605     public function data_feed_links_extra_should_output_nothing_when_filters_return_false() {
     602    public static function data_feed_links_extra_should_output_nothing_when_filters_return_false() {
    606603        return array(
    607604            'a post with a comment' => array(
Note: See TracChangeset for help on using the changeset viewer.