Make WordPress Core

Changeset 50491 for trunk


Ignore:
Timestamp:
03/04/2021 10:11:38 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Update inline comments in some test files per the documentation standards.

See #52628.

Location:
trunk/tests/phpunit/tests
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/formatting/SanitizeFileName.php

    r48937 r50491  
    66class Tests_Formatting_SanitizeFileName extends WP_UnitTestCase {
    77    function test_munges_extensions() {
    8         # r17990
     8        // r17990
    99        $file_name = sanitize_file_name( 'test.phtml.txt' );
    1010        $this->assertSame( 'test.phtml_.txt', $file_name );
  • trunk/tests/phpunit/tests/image/editorGd.php

    r50449 r50491  
    9090        $resized = $gd_image_editor->multi_resize( $sizes_array );
    9191
    92         # First, check to see if returned array is as expected
     92        // First, check to see if returned array is as expected.
    9393        $expected_array = array(
    9494            array(
     
    218218             */
    219219            array(
    220                 'width'  => 9999, # Arbitrary High Value
     220                'width'  => 9999, // Arbitrary high value.
    221221                'height' => 20,
    222222                'crop'   => false,
     
    229229            array(
    230230                'width'  => 45,
    231                 'height' => 9999, # Arbitrary High Value
     231                'height' => 9999, // Arbitrary high value.
    232232                'crop'   => true,
    233233            ),
     
    272272             */
    273273            array(
    274                 'width'  => -9999, # Arbitrary Negative Value
     274                'width'  => -9999, // Arbitrary negative value.
    275275                'height' => 70,
    276276            ),
     
    282282            array(
    283283                'width'  => 200,
    284                 'height' => -9999, # Arbitrary Negative Value
     284                'height' => -9999, // Arbitrary negative value.
    285285            ),
    286286        );
  • trunk/tests/phpunit/tests/image/editorImagick.php

    r50449 r50491  
    8484        $resized = $imagick_image_editor->multi_resize( $sizes_array );
    8585
    86         # First, check to see if returned array is as expected
     86        // First, check to see if returned array is as expected.
    8787        $expected_array = array(
    8888            array(
     
    212212             */
    213213            array(
    214                 'width'  => 9999, # Arbitrary High Value
     214                'width'  => 9999, // Arbitrary high value.
    215215                'height' => 20,
    216216                'crop'   => false,
     
    223223            array(
    224224                'width'  => 45,
    225                 'height' => 9999, # Arbitrary High Value
     225                'height' => 9999, // Arbitrary high value.
    226226                'crop'   => true,
    227227            ),
     
    266266             */
    267267            array(
    268                 'width'  => -9999, # Arbitrary Negative Value
     268                'width'  => -9999, // Arbitrary negative value.
    269269                'height' => 70,
    270270            ),
     
    276276            array(
    277277                'width'  => 200,
    278                 'height' => -9999, # Arbitrary Negative Value
     278                'height' => -9999, // Arbitrary negative value.
    279279            ),
    280280        );
  • trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php

    r50284 r50491  
    12061206
    12071207    /**
    1208      * Test single theme
     1208     * Test single theme.
    12091209     *
    12101210     * @ticket 50152
  • trunk/tests/phpunit/tests/sitemaps/functions.php

    r48937 r50491  
    102102            array( 'posts', 'page', 1, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=1' ) ),
    103103            array( 'posts', 'page', 5, home_url( '/?sitemap=posts&sitemap-subtype=page&paged=5' ) ),
    104             // post_type doesn't exist.
     104            // Post type doesn't exist.
    105105            array( 'posts', 'foo', 5, false ),
    106106            array( 'taxonomies', 'category', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=category&paged=1' ) ),
    107107            array( 'taxonomies', 'post_tag', 1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ),
     108            // Negative paged, gets converted to its absolute value.
    108109            array( 'taxonomies', 'post_tag', -1, home_url( '/?sitemap=taxonomies&sitemap-subtype=post_tag&paged=1' ) ),
    109             // negative paged, gets converted to it's absolute value.
    110110            array( 'users', '', 4, home_url( '/?sitemap=users&paged=4' ) ),
    111             // users provider doesn't allow subtypes.
     111            // Users provider doesn't allow subtypes.
    112112            array( 'users', 'foo', 4, false ),
    113             // provider doesn't exist.
     113            // Provider doesn't exist.
    114114            array( 'foo', '', 4, false ),
    115115        );
     
    117117
    118118    /**
    119      * Data provider for test_get_sitemap_url_pretty_permalinks
     119     * Data provider for test_get_sitemap_url_pretty_permalinks.
    120120     *
    121121     * @return array[] {
     
    134134            array( 'posts', 'page', 1, home_url( '/wp-sitemap-posts-page-1.xml' ) ),
    135135            array( 'posts', 'page', 5, home_url( '/wp-sitemap-posts-page-5.xml' ) ),
    136             // post_type doesn't exist.
     136            // Post type doesn't exist.
    137137            array( 'posts', 'foo', 5, false ),
    138138            array( 'taxonomies', 'category', 1, home_url( '/wp-sitemap-taxonomies-category-1.xml' ) ),
    139139            array( 'taxonomies', 'post_tag', 1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ),
    140             // negative paged, gets converted to it's absolute value.
     140            // Negative paged, gets converted to its absolute value.
    141141            array( 'taxonomies', 'post_tag', -1, home_url( '/wp-sitemap-taxonomies-post_tag-1.xml' ) ),
    142142            array( 'users', '', 4, home_url( '/wp-sitemap-users-4.xml' ) ),
    143             // users provider doesn't allow subtypes.
     143            // Users provider doesn't allow subtypes.
    144144            array( 'users', 'foo', 4, false ),
    145             // provider doesn't exist.
     145            // Provider doesn't exist.
    146146            array( 'foo', '', 4, false ),
    147147        );
  • trunk/tests/phpunit/tests/user/capabilities.php

    r50490 r50491  
    646646        foreach ( self::$users as $role => $user ) {
    647647
    648             # Test adding the cap directly to the user
     648            // Test adding the cap directly to the user.
    649649            $user->add_cap( 'do_not_allow' );
    650650            $has_cap = $user->has_cap( 'do_not_allow' );
     
    652652            $this->assertFalse( $has_cap, "User with the {$role} role should not have the do_not_allow capability" );
    653653
    654             # Test adding the cap via a filter
     654            // Test adding the cap via a filter.
    655655            add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 );
    656656            $has_cap = $user->has_cap( 'do_not_allow' );
     
    663663            }
    664664
    665             # Test adding the cap to the user's role
     665            // Test adding the cap to the user's role.
    666666            $role_obj = get_role( $role );
    667667            $role_obj->add_cap( 'do_not_allow' );
     
    677677     */
    678678    public function test_do_not_allow_is_denied_for_super_admins() {
    679         # Test adding the cap directly to the user
     679        // Test adding the cap directly to the user.
    680680        self::$super_admin->add_cap( 'do_not_allow' );
    681681        $has_cap = self::$super_admin->has_cap( 'do_not_allow' );
     
    683683        $this->assertFalse( $has_cap, 'Super admins should not have the do_not_allow capability' );
    684684
    685         # Test adding the cap via a filter
     685        // Test adding the cap via a filter.
    686686        add_filter( 'user_has_cap', array( $this, 'grant_do_not_allow' ), 10, 4 );
    687687        $has_cap = self::$super_admin->has_cap( 'do_not_allow' );
Note: See TracChangeset for help on using the changeset viewer.