- Timestamp:
- 09/02/2020 12:35:36 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/StripSlashesDeep.php
r48433 r48937 11 11 function test_preserves_original_datatype() { 12 12 13 $this->assert Equals( true,stripslashes_deep( true ) );14 $this->assert Equals( false,stripslashes_deep( false ) );15 $this->assert Equals( 4, stripslashes_deep( 4 ) );16 $this->assert Equals( 'foo', stripslashes_deep( 'foo' ) );13 $this->assertTrue( stripslashes_deep( true ) ); 14 $this->assertFalse( stripslashes_deep( false ) ); 15 $this->assertSame( 4, stripslashes_deep( 4 ) ); 16 $this->assertSame( 'foo', stripslashes_deep( 'foo' ) ); 17 17 $arr = array( 18 18 'a' => true, … … 22 22 ); 23 23 $arr['e'] = $arr; // Add a sub-array. 24 $this->assert Equals( $arr, stripslashes_deep( $arr ) ); // Keyed array.25 $this->assert Equals( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed.24 $this->assertSame( $arr, stripslashes_deep( $arr ) ); // Keyed array. 25 $this->assertSame( array_values( $arr ), stripslashes_deep( array_values( $arr ) ) ); // Non-keyed. 26 26 27 27 $obj = new stdClass; … … 29 29 $obj->$k = $v; 30 30 } 31 $this->assert Equals( $obj, stripslashes_deep( $obj ) );31 $this->assertSame( $obj, stripslashes_deep( $obj ) ); 32 32 } 33 33 … … 35 35 $old = "I can\'t see, isn\'t that it?"; 36 36 $new = "I can't see, isn't that it?"; 37 $this->assert Equals( $new, stripslashes_deep( $old ) );38 $this->assert Equals( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) );39 $this->assert Equals( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array.40 $this->assert Equals( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed.37 $this->assertSame( $new, stripslashes_deep( $old ) ); 38 $this->assertSame( $new, stripslashes_deep( "I can\\'t see, isn\\'t that it?" ) ); 39 $this->assertSame( array( 'a' => $new ), stripslashes_deep( array( 'a' => $old ) ) ); // Keyed array. 40 $this->assertSame( array( $new ), stripslashes_deep( array( $old ) ) ); // Non-keyed. 41 41 42 42 $obj_old = new stdClass; … … 49 49 function test_permits_escaped_slash() { 50 50 $txt = "I can't see, isn\'t that it?"; 51 $this->assert Equals( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) );52 $this->assert Equals( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) );51 $this->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\'t that it?" ) ); 52 $this->assertSame( $txt, stripslashes_deep( "I can\'t see, isn\\\\\'t that it?" ) ); 53 53 } 54 54 }
Note: See TracChangeset
for help on using the changeset viewer.