Changeset 1215 in tests
- Timestamp:
- 02/14/2013 10:51:37 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/factory.php
r1128 r1215 78 78 79 79 function create_object( $args ) { 80 return wp_insert_comment( $ this->addslashes_deep( $args ));80 return wp_insert_comment( $args ); 81 81 } 82 82 83 83 function update_object( $comment_id, $fields ) { 84 84 $fields['comment_ID'] = $comment_id; 85 return wp_update_comment( $ this->addslashes_deep( $fields ));85 return wp_update_comment( $fields ); 86 86 } 87 87 -
trunk/tests/admin/includesMisc.php
r909 r1215 7 7 function test_shorten_url() { 8 8 $tests = array( 9 // strip slashes 10 'wordpress\.org/about/philosophy' 11 => 'wordpress.org/about/philosophy', // strip slashes 9 'wordpress.org/about/philosophy' 10 => 'wordpress.org/about/philosophy', 12 11 'http://wordpress.org/about/philosophy/' 13 12 => 'wordpress.org/about/philosophy', // remove http, trailing slash -
trunk/tests/meta.php
r1207 r1215 125 125 $key = rand_str(); 126 126 $value = 'Test\\singleslash'; 127 $expected = 'Test singleslash';127 $expected = 'Test\\singleslash'; 128 128 $value2 = 'Test\\\\doubleslash'; 129 $expected2 = 'Test\\doubleslash'; 129 $expected2 = 'Test\\\\doubleslash'; 130 $value3 = 'Test\oneslash'; 131 $expected3 = 'Test\oneslash'; 130 132 $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 131 133 $this->assertFalse( delete_metadata( 'user', $this->author->ID, $key ) ); … … 150 152 $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value2 ) ); 151 153 $this->assertEquals( $expected2, get_metadata( 'user', $this->author->ID, $key, true ) ); 154 $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 155 $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 156 $this->assertFalse( metadata_exists( 'user', $this->author->ID, $key ) ); 157 158 $this->assertInternalType( 'int', add_metadata( 'user', $this->author->ID, $key, $value3 ) ); 159 $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) ); 160 $this->assertTrue( delete_metadata( 'user', $this->author->ID, $key ) ); 161 $this->assertSame( '', get_metadata( 'user', $this->author->ID, $key, true ) ); 162 $this->assertInternalType( 'int', update_metadata( 'user', $this->author->ID, $key, $value3 ) ); 163 $this->assertEquals( $expected3, get_metadata( 'user', $this->author->ID, $key, true ) ); 152 164 } 153 165 } -
trunk/tests/post/meta.php
r1207 r1215 220 220 $this->assertTrue( update_meta( $mid1, 'unique_update', addslashes( $data ) ) ); 221 221 $meta = get_metadata_by_mid( 'post', $mid1 ); 222 $this->assertEquals( $data, $meta->meta_value );222 $this->assertEquals( addslashes( $data ), $meta->meta_value ); 223 223 } 224 224 -
trunk/tests/post/slashes.php
r1148 r1215 41 41 $_POST['content'] = $this->slash_5; 42 42 $_POST['excerpt'] = $this->slash_7; 43 $_POST = add_magic_quotes( $_POST ); // the edit_post() function will strip slashes43 $_POST = wp_slash( $_POST ); // the edit_post() function will strip slashes 44 44 45 45 $post_id = edit_post(); … … 55 55 $_POST['content'] = $this->slash_4; 56 56 $_POST['excerpt'] = $this->slash_6; 57 $_POST = add_magic_quotes( $_POST );57 $_POST = wp_slash( $_POST ); 58 58 59 59 $post_id = edit_post();
Note: See TracChangeset
for help on using the changeset viewer.