Changeset 1148 in tests for trunk/tests/term/slashes.php
- Timestamp:
- 11/21/2012 03:01:28 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/tests/term/slashes.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/term/slashes.php
r1071 r1148 39 39 ); 40 40 $_POST = add_magic_quotes( $_POST ); 41 41 42 42 // Make the request 43 43 try { … … 46 46 unset( $e ); 47 47 } 48 48 49 49 $term = get_term_by( 'slug', 'string-with-1-slash', 'category' ); 50 50 $this->assertEquals( $this->slash_1, $term->name ); … … 57 57 ); 58 58 $_POST = add_magic_quotes( $_POST ); 59 59 60 60 // Make the request 61 61 try { … … 64 64 unset( $e ); 65 65 } 66 66 67 67 $term = get_term_by( 'slug', 'string-with-3-slashes', 'category' ); 68 68 $this->assertEquals( $this->slash_3, $term->name ); … … 75 75 ); 76 76 $_POST = add_magic_quotes( $_POST ); 77 77 78 78 // Make the request 79 79 try { … … 82 82 unset( $e ); 83 83 } 84 84 85 85 $term = get_term_by( 'slug', 'string-with-2-slashes', 'category' ); 86 86 $this->assertEquals( $this->slash_2, $term->name ); 87 87 88 88 } 89 89 90 90 /** 91 91 * Tests the controller function that expects slashed data … … 99 99 foreach ( $taxonomies as $taxonomy ) { 100 100 $_POST = $_GET = $_REQUEST = array(); 101 101 102 102 $_POST = array( 103 103 '_wpnonce_add-tag' => wp_create_nonce( 'add-tag' ), … … 108 108 ); 109 109 $_POST = add_magic_quotes( $_POST ); 110 110 111 111 // Make the request 112 112 try { … … 115 115 unset( $e ); 116 116 } 117 117 118 118 $term = get_term_by( 'slug', 'controller_slash_test_1_'.$taxonomy, $taxonomy ); 119 119 $this->assertEquals( $this->slash_1, $term->name ); … … 128 128 ); 129 129 $_POST = add_magic_quotes( $_POST ); 130 130 131 131 // Make the request 132 132 try { … … 135 135 unset( $e ); 136 136 } 137 137 138 138 $term = get_term_by( 'slug', 'controller_slash_test_2_'.$taxonomy, $taxonomy ); 139 139 $this->assertEquals( $this->slash_3, $term->name ); … … 148 148 ); 149 149 $_POST = add_magic_quotes( $_POST ); 150 150 151 151 // Make the request 152 152 try { … … 155 155 unset( $e ); 156 156 } 157 157 158 158 $term = get_term_by( 'slug', 'controller_slash_test_3_'.$taxonomy, $taxonomy ); 159 159 $this->assertEquals( $this->slash_2, $term->name ); … … 161 161 } 162 162 } 163 163 164 164 /** 165 165 * Tests the model function that expects un-slashed data … … 183 183 $this->assertEquals( $this->slash_1, $term->name ); 184 184 $this->assertEquals( $this->slash_3, $term->description ); 185 185 186 186 $insert = wp_insert_term( 187 187 $this->slash_3, … … 195 195 $this->assertEquals( $this->slash_3, $term->name ); 196 196 $this->assertEquals( $this->slash_5, $term->description ); 197 197 198 198 $insert = wp_insert_term( 199 199 $this->slash_2, … … 223 223 'taxonomy' => $taxonomy 224 224 )); 225 225 226 226 $update = wp_update_term( 227 227 $id, … … 236 236 $this->assertEquals( $this->slash_1, $term->name ); 237 237 $this->assertEquals( $this->slash_3, $term->description ); 238 238 239 239 $update = wp_update_term( 240 240 $id, … … 248 248 $this->assertEquals( $this->slash_3, $term->name ); 249 249 $this->assertEquals( $this->slash_5, $term->description ); 250 250 251 251 $update = wp_update_term( 252 252 $id,
Note: See TracChangeset
for help on using the changeset viewer.