Changeset 54088 for trunk/tests/phpunit/tests/oembed/WpEmbed.php
- Timestamp:
- 09/06/2022 10:03:10 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/oembed/WpEmbed.php
r51568 r54088 29 29 30 30 public function test_maybe_run_ajax_cache_should_return_nothing_if_there_is_no_message() { 31 $GLOBALS['post'] = $this->factory()->post->create_and_get(31 $GLOBALS['post'] = self::factory()->post->create_and_get( 32 32 array( 33 33 'post_title' => 'Hello World', … … 42 42 43 43 public function test_maybe_run_ajax_cache_should_return_javascript() { 44 $GLOBALS['post'] = $this->factory()->post->create_and_get(44 $GLOBALS['post'] = self::factory()->post->create_and_get( 45 45 array( 46 46 'post_title' => 'Hello World', … … 135 135 136 136 public function test_delete_oembed_caches() { 137 $post_id = $this->factory()->post->create();137 $post_id = self::factory()->post->create(); 138 138 139 139 add_post_meta( $post_id, '_oembed_foo', 'bar' ); … … 148 148 149 149 public function test_cache_oembed_invalid_post_type() { 150 $post_id = $this->factory()->post->create( array( 'post_type' => 'nav_menu_item' ) );150 $post_id = self::factory()->post->create( array( 'post_type' => 'nav_menu_item' ) ); 151 151 152 152 $this->wp_embed->cache_oembed( $post_id ); … … 155 155 156 156 public function test_cache_oembed_empty_content() { 157 $post_id = $this->factory()->post->create( array( 'post_content' => '' ) );157 $post_id = self::factory()->post->create( array( 'post_content' => '' ) ); 158 158 159 159 $this->wp_embed->cache_oembed( $post_id ); … … 168 168 $cachekey_time = '_oembed_time_' . $key_suffix; 169 169 170 $post_id = $this->factory()->post->create( array( 'post_content' => 'https://example.com/' ) );170 $post_id = self::factory()->post->create( array( 'post_content' => 'https://example.com/' ) ); 171 171 172 172 add_filter( 'pre_oembed_result', array( $this, '_pre_oembed_result_callback' ) ); … … 182 182 global $post; 183 183 184 $post = $this->factory()->post->create_and_get();184 $post = self::factory()->post->create_and_get(); 185 185 $url = 'https://example.com/'; 186 186 $expected = '<b>Embedded content</b>'; … … 209 209 global $post; 210 210 211 $post = $this->factory()->post->create_and_get();211 $post = self::factory()->post->create_and_get(); 212 212 $url = 'https://example.com/'; 213 213 $expected = '<a href="' . esc_url( $url ) . '">' . esc_html( $url ) . '</a>';
Note: See TracChangeset
for help on using the changeset viewer.