You appear to be a bot. Output may be restricted
Description
Tests the model function that expects slashed data
Usage
Tests_Post_Slashes::test_wp_insert_post();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/post/slashes.php
Lines:
1 to 33 of 33
function test_wp_insert_post() { $id = wp_insert_post( array( 'post_status' => 'publish', 'post_title' => $this->slash_1, 'post_content' => $this->slash_3, 'post_excerpt' => $this->slash_5, 'post_type' => 'post', 'slashed' => false, ) ); $post = get_post( $id ); $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title ); $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content ); $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt ); $id = wp_insert_post( array( 'post_status' => 'publish', 'post_title' => $this->slash_2, 'post_content' => $this->slash_4, 'post_excerpt' => $this->slash_6, 'post_type' => 'post', ) ); $post = get_post( $id ); $this->assertEquals( wp_unslash( $this->slash_2 ), $post->post_title ); $this->assertEquals( wp_unslash( $this->slash_4 ), $post->post_content ); $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt ); }