Changeset 37732 for branches/4.5/tests/phpunit/tests/oembed/wpOembed.php
- Timestamp:
- 06/16/2016 05:29:51 PM (8 years ago)
- Location:
- branches/4.5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.5
-
branches/4.5/tests/phpunit/tests/oembed/wpOembed.php
r37711 r37732 25 25 $this->pre_oembed_result_filtered = $result; 26 26 27 return $result; 27 // Return false to prevent HTTP requests during tests. 28 return $result ? $result : false; 28 29 } 29 30 … … 54 55 $this->assertEquals( $this->pre_oembed_result_filtered, $actual ); 55 56 } 57 58 public function test_wp_filter_pre_oembed_result_non_existent_post() { 59 $post_id = self::factory()->post->create(); 60 $permalink = get_permalink( $post_id ); 61 62 $this->go_to( $permalink ); 63 $this->assertQueryTrue( 'is_single', 'is_singular' ); 64 65 add_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) ); 66 $actual = $this->oembed->get_html( 'https://example.com/' ); 67 remove_filter( 'pre_oembed_result', array( $this, '_filter_pre_oembed_result' ) ); 68 69 $this->assertTrue( false !== $this->pre_oembed_result_filtered ); 70 $this->assertFalse( $actual ); 71 } 56 72 }
Note: See TracChangeset
for help on using the changeset viewer.