Changeset 1330 in tests
- Timestamp:
- 07/30/2013 08:25:36 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/post/formats.php
r1312 r1330 106 106 $commentary 107 107 DATA; 108 $href = '<a href="http://nytimes.com">NYT</a>'; 109 $href_with_commentary =<<<DATA 110 $href 108 111 112 $commentary 113 DATA; 109 114 $link_post_id = $this->factory->post->create( array( 'post_content' => $link ) ); 110 115 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) ); 111 $this->assertEquals( $content_link, $link );116 $this->assertEquals( false, $content_link ); 112 117 113 118 $link_with_post_id = $this->factory->post->create( array( 'post_content' => $link_with_commentary ) ); 114 119 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) ); 115 $this->assertEquals( $content_link, $link );120 $this->assertEquals( false, $content_link ); 116 121 117 122 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) ); 118 $this->assertEquals( $content_link, $link );123 $this->assertEquals( false, $content_link ); 119 124 120 125 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) ); 121 $this->assertEquals( $content_link, $link );126 $this->assertEquals( false, $content_link ); 122 127 123 128 $empty_post_id = $this->factory->post->create( array( 'post_content' => '' ) ); 124 129 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 125 $this->assertEquals( $content_link, '');130 $this->assertEquals( false, $content_link ); 126 131 127 132 $comm_post_id = $this->factory->post->create( array( 'post_content' => $commentary ) ); 128 update_post_meta( $comm_post_id, '_format_url', $link );129 133 $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) ); 130 $this->assertEquals( $content_link, '' ); 134 $this->assertEquals( false, $content_link ); 135 136 // Now with an href 137 $href_post_id = $this->factory->post->create( array( 'post_content' => $href ) ); 138 $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) ); 139 $this->assertEquals( $link, $content_link ); 140 141 $href_with_post_id = $this->factory->post->create( array( 'post_content' => $href_with_commentary ) ); 142 $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) ); 143 $this->assertEquals( $link, $content_link ); 144 145 $content_link = get_url_in_content( get_post_field( 'post_content', $href_post_id ) ); 146 $this->assertEquals( $link, $content_link ); 147 148 $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) ); 149 $this->assertEquals( $link, $content_link ); 150 151 $empty_post_id = $this->factory->post->create( array( 'post_content' => '' ) ); 152 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 153 $this->assertEquals( false, $content_link ); 154 155 $comm_post_id = $this->factory->post->create( array( 'post_content' => $commentary ) ); 156 $content_link = get_url_in_content( get_post_field( 'post_content', $comm_post_id ) ); 157 $this->assertEquals( false, $content_link ); 131 158 } 132 159 }
Note: See TracChangeset
for help on using the changeset viewer.