$this->author->ID,
'post_status' => 'publish',
'post_content' => $this->post_content,
'post_title' => $this->post_title,
);
// insert a post
$this->post_id = $this->post_ids[] = wp_insert_post($post);
// pretend we're on the single permlink page for that post
$out = wp_get_single_post($this->post_id);
$this->http(get_permalink($this->post_id));
$this->assertTrue(is_single());
$this->assertTrue(have_posts());
$this->assertNull(the_post());
}
}
class WPTestPostMoreVB extends _WPTestSinglePost {
function setUp() {
$this->post_content =<<
This is the body.
my graf
another graf with whitespace
An
inline graf
, this doesn’t make much sense.A graf with a single EOL first:
blah
EOF; $this->assertEquals(strip_ws($expected), strip_ws(get_echo('the_content'))); } } class WPTestGalleryPost extends _WPDataset1 { function setUp() { $this->knownUTBug(30); parent::setUp(); global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/'); $wp_rewrite->flush_rules(); } function test_the_content() { // permalink page $link = '/2008/04/01/simple-gallery-test/'; $this->http('/2008/04/01/simple-gallery-test/'); the_post(); // filtered output $out = get_echo('the_content'); $this->assertNotEmpty($out, "Could not get the_content for $link."); $expected = <<It’s the simplest form of the gallery tag. All images are from the public domain site burningwell.org.
The images have various combinations of titles, captions and descriptions.
EOF; $this->assertEquals(strip_ws($expected), strip_ws($out)); } function test_gallery_attributes() { // make sure the gallery shortcode attributes are parsed correctly $id = 575; $post = get_post($id); $this->assertNotNull($post, "get_post($id) could not find the post."); $post->post_content = '[gallery columns="1" size="medium"]'; wp_update_post($post); // permalink page $this->http('/2008/04/01/simple-gallery-test/'); the_post(); // filtered output $out = get_echo('the_content'); $expected = <<