Changeset 42343 for trunk/tests/phpunit/tests/post/formats.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/tests/post/formats.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/post/formats.php
r35242 r42343 99 99 */ 100 100 function test_get_url_in_content() { 101 $link = 'http://nytimes.com';102 $commentary = 'This is my favorite link';103 $link_with_commentary = <<<DATA101 $link = 'http://nytimes.com'; 102 $commentary = 'This is my favorite link'; 103 $link_with_commentary = <<<DATA 104 104 $link 105 105 106 106 $commentary 107 107 DATA; 108 $href = '<a href="http://nytimes.com">NYT</a>';109 $href_with_commentary = <<<DATA108 $href = '<a href="http://nytimes.com">NYT</a>'; 109 $href_with_commentary = <<<DATA 110 110 $href 111 111 112 112 $commentary 113 113 DATA; 114 $link_post_id = self::factory()->post->create( array( 'post_content' => $link ) );115 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) );114 $link_post_id = self::factory()->post->create( array( 'post_content' => $link ) ); 115 $content_link = get_url_in_content( get_post_field( 'post_content', $link_post_id ) ); 116 116 $this->assertEquals( false, $content_link ); 117 117 118 118 $link_with_post_id = self::factory()->post->create( array( 'post_content' => $link_with_commentary ) ); 119 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) );119 $content_link = get_url_in_content( get_post_field( 'post_content', $link_with_post_id ) ); 120 120 $this->assertEquals( false, $content_link ); 121 121 … … 127 127 128 128 $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) ); 129 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );129 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 130 130 $this->assertEquals( false, $content_link ); 131 131 … … 140 140 141 141 $href_with_post_id = self::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 ) );142 $content_link = get_url_in_content( get_post_field( 'post_content', $href_with_post_id ) ); 143 143 $this->assertEquals( $link, $content_link ); 144 144 … … 150 150 151 151 $empty_post_id = self::factory()->post->create( array( 'post_content' => '' ) ); 152 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) );152 $content_link = get_url_in_content( get_post_field( 'post_content', $empty_post_id ) ); 153 153 $this->assertEquals( false, $content_link ); 154 154
Note: See TracChangeset
for help on using the changeset viewer.