/**
  * Check to make sure that get_ical_link function works as expected
  *
  * @uses $post_example_settings
  */
 public function test_get_ical_link_single()
 {
     global $post;
     $post = get_post(Tribe__Events__API::createEvent($this->post_example_settings));
     $this->assertTrue($post instanceof WP_Post, 'Check that post creates properly');
     $ical_link_single_via_object = Tribe__Events__iCal::get_ical_link('single');
     $this->assertNotEmpty(filter_var($ical_link_single_via_object, FILTER_VALIDATE_URL), 'Checking that we get back a valid URL from object');
     $ical_link_single_via_function = tribe_get_single_ical_link();
     $this->assertNotEmpty(filter_var($ical_link_single_via_function, FILTER_VALIDATE_URL), 'Checking that we get back a valid URL from function');
     $this->assertEquals($ical_link_single_via_object, $ical_link_single_via_function, 'Check that the function and object get the same result');
 }
예제 #2
0
 /**
  * iCal Link
  *
  * Returns a sitewide ical link
  *
  * @return string URL for ical dump.
  */
 function tribe_get_ical_link()
 {
     $output = Tribe__Events__iCal::get_ical_link();
     return apply_filters('tribe_get_ical_link', $output);
 }