Changeset 36787
- Timestamp:
- 02/29/2016 10:13:28 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/meta/slashes.php
r35249 r36787 144 144 145 145 /** 146 * Tests the model function that expects un-slashed data147 *148 */149 function test_wp_add_post_meta() {150 if ( !function_exists( 'wp_add_post_meta' ) ) {151 return;152 }153 $id = self::factory()->post->create();154 wp_add_post_meta( $id, 'slash_test_1', $this->slash_1 );155 wp_add_post_meta( $id, 'slash_test_2', $this->slash_3 );156 wp_add_post_meta( $id, 'slash_test_3', $this->slash_4 );157 158 $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );159 $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );160 $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );161 }162 163 /**164 * Tests the model function that expects un-slashed data165 *166 */167 function test_wp_update_post_meta() {168 if ( !function_exists( 'wp_update_post_meta' ) ) {169 return;170 }171 $id = self::factory()->post->create();172 wp_update_post_meta( $id, 'slash_test_1', $this->slash_1 );173 wp_update_post_meta( $id, 'slash_test_2', $this->slash_3 );174 wp_update_post_meta( $id, 'slash_test_3', $this->slash_4 );175 176 $this->assertEquals( $this->slash_1, get_post_meta( $id, 'slash_test_1', true ) );177 $this->assertEquals( $this->slash_3, get_post_meta( $id, 'slash_test_2', true ) );178 $this->assertEquals( $this->slash_4, get_post_meta( $id, 'slash_test_3', true ) );179 }180 181 /**182 146 * Tests the model function that expects slashed data 183 147 *
Note: See TracChangeset
for help on using the changeset viewer.