Changeset 48937 for trunk/tests/phpunit/tests/formatting/WPSlash.php
- Timestamp:
- 09/02/2020 12:35:36 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/WPSlash.php
r48442 r48937 58 58 $old = "I can't see, isn't that it?"; 59 59 $new = "I can\'t see, isn\'t that it?"; 60 $this->assert Equals( $new, wp_slash( $old ) );61 $this->assert Equals( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) );62 $this->assert Equals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.63 $this->assert Equals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.60 $this->assertSame( $new, wp_slash( $old ) ); 61 $this->assertSame( "I can\\\\\'t see, isn\\\\\'t that it?", wp_slash( $new ) ); 62 $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array. 63 $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed. 64 64 } 65 65 … … 69 69 function test_preserves_original_datatype() { 70 70 71 $this->assert Equals( true,wp_slash( true ) );72 $this->assert Equals( false,wp_slash( false ) );73 $this->assert Equals( 4, wp_slash( 4 ) );74 $this->assert Equals( 'foo', wp_slash( 'foo' ) );71 $this->assertTrue( wp_slash( true ) ); 72 $this->assertFalse( wp_slash( false ) ); 73 $this->assertSame( 4, wp_slash( 4 ) ); 74 $this->assertSame( 'foo', wp_slash( 'foo' ) ); 75 75 $arr = array( 76 76 'a' => true, … … 80 80 ); 81 81 $arr['e'] = $arr; // Add a sub-array. 82 $this->assert Equals( $arr, wp_slash( $arr ) ); // Keyed array.83 $this->assert Equals( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed.82 $this->assertSame( $arr, wp_slash( $arr ) ); // Keyed array. 83 $this->assertSame( array_values( $arr ), wp_slash( array_values( $arr ) ) ); // Non-keyed. 84 84 85 85 $obj = new stdClass; … … 87 87 $obj->$k = $v; 88 88 } 89 $this->assert Equals( $obj, wp_slash( $obj ) );89 $this->assertSame( $obj, wp_slash( $obj ) ); 90 90 } 91 91 … … 96 96 $old = 'single\\slash double\\\\slash triple\\\\\\slash'; 97 97 $new = 'single\\\\slash double\\\\\\\\slash triple\\\\\\\\\\\\slash'; 98 $this->assert Equals( $new, wp_slash( $old ) );99 $this->assert Equals( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array.100 $this->assert Equals( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed.98 $this->assertSame( $new, wp_slash( $old ) ); 99 $this->assertSame( array( 'a' => $new ), wp_slash( array( 'a' => $old ) ) ); // Keyed array. 100 $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed. 101 101 } 102 102
Note: See TracChangeset
for help on using the changeset viewer.