$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 excerpt. This is the body. EOF; parent::setUp(); } function test_the_content() { $this->_do_post(); $the_content =<<This is the excerpt.

This is the body.

EOF; $this->assertEquals(strip_ws($the_content), strip_ws(get_echo('the_content'))); } } class WPTestShortcodeOutput1 extends _WPTestSinglePost { function setUp() { $this->post_content =<<_do_post(); $expected =<<assertEquals(strip_ws($expected), strip_ws(get_echo('the_content'))); } } class WPTestShortcodeOutputParagraph extends _WPTestSinglePost { function setUp() { $this->post_content =<<_do_post(); $expected =<<Graf by itself:

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() { parent::setUp(); global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/'); $wp_rewrite->flush_rules(); } function test_the_content() { // permalink page $this->http('/2008/04/01/simple-gallery-test/'); the_post(); // filtered output $out = get_echo('the_content'); $expected = <<There are ten images attached to this post.  Here’s a gallery:

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); $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 = << .gallery { margin: auto; } .gallery-item { float: left; margin-top: 10px; text-align: center; width: 100%; } .gallery img { border: 2px solid #cfcfcf; } .gallery-caption { margin-left: 0; } EOF; $this->assertEquals(strip_ws($expected), strip_ws($out)); } } class WPTestAttributeFiltering extends _WPTestSinglePost { function setUp() { // http://bpr3.org/?p=87 // the title attribute should make it through unfiltered $this->post_content =<<Mariat, D., Taourit, S., Guérin, G. (2003). . Genetics Selection Evolution, 35(1), 119-133. DOI: 10.1051/gse:2002039 EOF; parent::setUp(); } function test_the_content() { $this->_do_post(); $expected =<<Mariat, D., Taourit, S., Guérin, G. (2003). . Genetics Selection Evolution, 35(1), 119-133. DOI: 10.1051/gse:2002039

EOF; $this->assertEquals(strip_ws($expected), strip_ws(get_echo('the_content'))); } } class WPTestAttributeColon extends _WPTestSinglePost { function setUp() { // http://bpr3.org/?p=87 // the title attribute should make it through unfiltered $this->post_content =<<foo EOF; parent::setUp(); } function test_the_content() { $this->_do_post(); $expected =<<foo

EOF; $this->assertEquals(strip_ws($expected), strip_ws(get_echo('the_content'))); } } ?>