Make WordPress Core


Ignore:
Timestamp:
09/19/2020 10:53:15 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Give the $id variable in slashed data tests a more descriptive name.

See #50767, #51344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/term/slashes.php

    r49003 r49004  
    8383                );
    8484                foreach ( $taxonomies as $taxonomy ) {
    85                         $id = self::factory()->term->create(
     85                        $term_id = self::factory()->term->create(
    8686                                array(
    8787                                        'taxonomy' => $taxonomy,
     
    9090
    9191                        $update = wp_update_term(
    92                                 $id,
     92                                $term_id,
    9393                                $taxonomy,
    9494                                array(
     
    9898                        );
    9999
    100                         $term = get_term( $id, $taxonomy );
     100                        $term = get_term( $term_id, $taxonomy );
    101101                        $this->assertSame( wp_unslash( $this->slash_1 ), $term->name );
    102102                        $this->assertSame( wp_unslash( $this->slash_3 ), $term->description );
    103103
    104104                        $update = wp_update_term(
    105                                 $id,
     105                                $term_id,
    106106                                $taxonomy,
    107107                                array(
     
    110110                                )
    111111                        );
    112                         $term   = get_term( $id, $taxonomy );
     112                        $term   = get_term( $term_id, $taxonomy );
    113113                        $this->assertSame( wp_unslash( $this->slash_3 ), $term->name );
    114114                        $this->assertSame( wp_unslash( $this->slash_5 ), $term->description );
    115115
    116116                        $update = wp_update_term(
    117                                 $id,
     117                                $term_id,
    118118                                $taxonomy,
    119119                                array(
     
    122122                                )
    123123                        );
    124                         $term   = get_term( $id, $taxonomy );
     124                        $term   = get_term( $term_id, $taxonomy );
    125125                        $this->assertSame( wp_unslash( $this->slash_2 ), $term->name );
    126126                        $this->assertSame( wp_unslash( $this->slash_4 ), $term->description );
Note: See TracChangeset for help on using the changeset viewer.