post_ids[] = wp_insert_post(array_merge(array( 'post_author' => $this->author->ID, 'post_status' => 'publish', 'post_title' => $title, 'post_content' => $content, ), $more)); } // a simple test to make sure unclosed tags are fixed function test_post_content_unknown_tag() { $content = <<no such tag EOF; $expected = <<_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // a simple test to make sure unbalanced tags are fixed function test_post_content_unbalanced_tag() { $content = <<italics EOF; $expected = <<italics EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // make sure unbalanced tags are fixed when they span a --more-- tag function test_post_content_unbalanced_more() { $content = <<some text that's continued after the jump EOF; $expected = <<some text that's continued after the jump EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // make sure unbalanced tags are fixed when they span a --nextpage-- tag function test_post_content_unbalanced_nextpage() { $content = <<some text that's continued after the jump EOF; $expected = <<some text that's continued after the jump EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // make sure unbalanced tags are fixed when they span both --more-- and --nextpage-- tags (in that order) function test_post_content_unbalanced_more_nextpage() { $content = <<some text that's continued after the jump

and the next page breaks the graf

EOF; $expected = <<some text that's continued after the jump

and the next page

breaks the graf EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // make sure unbalanced tags are fixed when they span both --nextpage-- and --more-- tags (in that order) function test_post_content_unbalanced_nextpage_more() { $content = <<some text that's continued after the jump

and the next page breaks the graf

EOF; $expected = <<some text that's continued after the jump

and the next page

breaks the graf EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $expected, $post->post_content ); } // make sure unbalanced tags are untouched when the balance option is off function test_post_content_nobalance_nextpage_more() { update_option('use_balanceTags', 0); $content = <<some text that's continued after the jump

and the next page breaks the graf

EOF; $id = $this->_insert_quick_post(__FUNCTION__, $content); $post = get_post($id); $this->assertEquals( $content, $post->post_content ); } } ?>