Esempio n. 1
0
 /**
  * Test the wp_oembed_excerpt_more function.
  */
 function test_wp_oembed_excerpt_more()
 {
     $GLOBALS['wp_query'] = new WP_Query();
     $GLOBALS['wp_query']->query_vars['embed'] = true;
     $GLOBALS['post'] = $this->factory->post->create_and_get(array('post_content' => 'Foo Bar'));
     $actual = wp_oembed_excerpt_more('');
     $this->assertEquals(' <span class="wp-embed-more">&hellip; (2 words)&lrm;</span>', $actual);
 }
Esempio n. 2
0
 /**
  * Test excerpt function.
  */
 function test_wp_oembed_excerpt_more()
 {
     $post_id = $this->factory->post->create(array('post_content' => 'Foo Bar'));
     $this->assertEquals('', wp_oembed_excerpt_more(''));
     $this->go_to(get_post_embed_url($post_id));
     $actual = wp_oembed_excerpt_more('');
     $expected = sprintf('&hellip; <a class="wp-embed-more" href="%s" target="_top">Read more</a>', get_the_permalink());
     $this->assertEquals($expected, $actual);
 }