You appear to be a bot. Output may be restricted
Description
Tests the model function that expects slashed data
Usage
Tests_Attachment_Slashes::test_wp_insert_attachment();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/attachment/slashes.php
Lines:
1 to 32 of 32
function test_wp_insert_attachment() { $id = wp_insert_attachment( array( 'post_status' => 'publish', 'post_title' => $this->slash_1, 'post_content_filtered' => $this->slash_3, 'post_excerpt' => $this->slash_5, 'post_type' => 'post', ) ); $post = get_post( $id ); $this->assertEquals( wp_unslash( $this->slash_1 ), $post->post_title ); $this->assertEquals( wp_unslash( $this->slash_3 ), $post->post_content_filtered ); $this->assertEquals( wp_unslash( $this->slash_5 ), $post->post_excerpt ); $id = wp_insert_attachment( array( 'post_status' => 'publish', 'post_title' => $this->slash_2, 'post_content_filtered' => $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_filtered ); $this->assertEquals( wp_unslash( $this->slash_6 ), $post->post_excerpt ); }