Changeset 61590 for trunk/tests/phpunit/tests/formatting/wpSlash.php
- Timestamp:
- 02/04/2026 06:51:51 PM (5 months ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/formatting/wpSlash.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/formatting/wpSlash.php
r56547 r61590 102 102 $this->assertSame( array( $new ), wp_slash( array( $old ) ) ); // Non-keyed. 103 103 } 104 105 /** 106 * Tests that addslashes_gpc() returns the same result as wp_slash() for strings. 107 * 108 * @ticket 64539 109 * @covers ::addslashes_gpc 110 * @expectedDeprecated addslashes_gpc 111 */ 112 public function test_addslashes_gpc_matches_wp_slash_for_strings() { 113 $input = "String with 'quotes' and \"double quotes\""; 114 $this->assertSame( wp_slash( $input ), addslashes_gpc( $input ) ); 115 } 116 117 /** 118 * Tests that addslashes_gpc() returns the same result as wp_slash() for arrays. 119 * 120 * @ticket 64539 121 * @covers ::addslashes_gpc 122 * @expectedDeprecated addslashes_gpc 123 */ 124 public function test_addslashes_gpc_matches_wp_slash_for_arrays() { 125 $input = array( 126 'field1' => "Value with 'apostrophe'", 127 'field2' => 'Value with "quotes"', 128 'field3' => 'user@example.com', 129 'nested' => array( 130 'key1' => 'Nested value with \\ backslash', 131 'key2' => array( 'deeply', 'nested', 'array' ), 132 ), 133 ); 134 135 $this->assertSame( wp_slash( $input ), addslashes_gpc( $input ) ); 136 } 104 137 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)