Make WordPress Core

Changeset 1264 in tests for trunk/tests/comment/slashes.php


Ignore:
Timestamp:
04/22/2013 04:36:35 PM (13 years ago)
Author:
ryan
Message:

Update the tests for #WP21767 to expect slashed data. Round 1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/comment/slashes.php

    r1148 r1264  
    3131
    3232        /**
    33          * Tests the extended model function that expects un-slashed data
     33         * Tests the extended model function that expects slashed data
    3434         *
    3535         */
     
    4848                $comment = get_comment($id);
    4949
    50                 $this->assertEquals( $this->slash_1, $comment->comment_author );
    51                 $this->assertEquals( $this->slash_7, $comment->comment_content );
     50                $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
     51                $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
    5252
    5353                $data = array(
     
    6060                $comment = get_comment($id);
    6161
    62                 $this->assertEquals( $this->slash_2, $comment->comment_author );
    63                 $this->assertEquals( $this->slash_4, $comment->comment_content );
     62                $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
     63                $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
    6464        }
    6565
     
    102102
    103103        /**
    104          * Tests the model function that expects un-slashed data
     104         * Tests the model function that expects slashed data
    105105         *
    106106         */
     
    115115                $comment = get_comment( $comment_id );
    116116
    117                 $this->assertEquals( $this->slash_1, $comment->comment_author );
    118                 $this->assertEquals( $this->slash_7, $comment->comment_content );
     117                $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
     118                $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
    119119
    120120                $comment_id = wp_insert_comment(array(
     
    125125                $comment = get_comment( $comment_id );
    126126
    127                 $this->assertEquals( $this->slash_2, $comment->comment_author );
    128                 $this->assertEquals( $this->slash_4, $comment->comment_content );
     127                $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
     128                $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
    129129        }
    130130
    131131        /**
    132          * Tests the model function that expects un-slashed data
     132         * Tests the model function that expects slashed data
    133133         *
    134134         */
     
    146146                $comment = get_comment( $comment_id );
    147147
    148                 $this->assertEquals( $this->slash_1, $comment->comment_author );
    149                 $this->assertEquals( $this->slash_7, $comment->comment_content );
     148                $this->assertEquals( wp_unslash( $this->slash_1 ), $comment->comment_author );
     149                $this->assertEquals( wp_unslash( $this->slash_7 ), $comment->comment_content );
    150150
    151151                wp_update_comment(array(
     
    156156                $comment = get_comment( $comment_id );
    157157
    158                 $this->assertEquals( $this->slash_2, $comment->comment_author );
    159                 $this->assertEquals( $this->slash_4, $comment->comment_content );
     158                $this->assertEquals( wp_unslash( $this->slash_2 ), $comment->comment_author );
     159                $this->assertEquals( wp_unslash( $this->slash_4 ), $comment->comment_content );
    160160        }
    161161
Note: See TracChangeset for help on using the changeset viewer.