| 30 |
*/ |
*/ |
| 31 |
function testFeedRedirection() { |
function testFeedRedirection() { |
| 32 |
// Save redirection and test that path is redirected. |
// Save redirection and test that path is redirected. |
| 33 |
feedburner_save_feed('rss.xml', 'example-feed'); |
feedburner_save(array('path' => 'rss.xml', 'feedburner' => 'example-feed')); |
| 34 |
$this->assertRedirected('rss.xml', t('Feed was redirected.')); |
$this->assertRedirected('rss.xml', t('Feed was redirected.')); |
| 35 |
$this->assertText('FeedBurner feed'); |
$this->assertText('FeedBurner feed'); |
| 36 |
// $this->assertText('This feed was created for testing the Drupal FeedBurner module.'); |
// $this->assertText('This feed was created for testing the Drupal FeedBurner module.'); |
| 45 |
$this->assertText('Local feed'); |
$this->assertText('Local feed'); |
| 46 |
|
|
| 47 |
// Remove redirection and test that path is not redirected. |
// Remove redirection and test that path is not redirected. |
| 48 |
feedburner_save_feed('rss.xml'); |
feedburner_delete(array('path' => 'rss.xml')); |
| 49 |
$this->assertNotRedirected('rss.xml', t('Feed was not directed.')); |
$this->assertNotRedirected('rss.xml', t('Feed was not directed.')); |
| 50 |
|
|
| 51 |
// Unset the path alias (causes test errors later). |
// Unset the path alias (causes test errors later). |
| 62 |
$this->assertTrue(cache_get(url('rss.xml', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.')); |
$this->assertTrue(cache_get(url('rss.xml', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.')); |
| 63 |
|
|
| 64 |
// Enable redirection for feed. |
// Enable redirection for feed. |
| 65 |
feedburner_save_feed('rss.xml', 'example-feed'); |
feedburner_save(array('path' => 'rss.xml', 'feedburner' => 'example-feed')); |
| 66 |
|
|
| 67 |
// Test redirection with normal caching. |
// Test redirection with normal caching. |
| 68 |
$this->assertRedirected('rss.xml', t('Feed was redirected with normal caching enabled.')); |
$this->assertRedirected('rss.xml', t('Feed was redirected with normal caching enabled.')); |
| 119 |
* Test replacing internal feed links in HTML to FeedBurner feed links. |
* Test replacing internal feed links in HTML to FeedBurner feed links. |
| 120 |
*/ |
*/ |
| 121 |
function testFeedHTMLReplacement() { |
function testFeedHTMLReplacement() { |
| 122 |
|
$original_url = url('rss.xml'); |
| 123 |
|
$feedburner_url = _feedburner_construct_url('example-feed'); |
| 124 |
|
|
| 125 |
// Enable a FeedBurner feed and check the proper original HTML is found. |
// Enable a FeedBurner feed and check the proper original HTML is found. |
| 126 |
feedburner_save_feed('rss.xml', 'example-feed'); |
feedburner_save(array('path' => 'rss.xml', 'feedburner' => 'example-feed')); |
| 127 |
$this->drupalGet(''); |
$this->drupalGet(''); |
| 128 |
$this->assertRaw(url('rss.xml', array('absolute' => TRUE)), t('Original feed URL found.')); |
$this->assertRaw($original_url, t('Original feed URL found.')); |
| 129 |
$this->assertNoRaw(_feedburner_construct_url('example-feed'), t('FeedBurner feed URL not found.')); |
$this->assertNoRaw($feedburner_url, t('FeedBurner feed URL not found.')); |
| 130 |
|
|
| 131 |
// Turn on feed HTML replacement and caching. |
// Turn on feed HTML replacement and caching. |
| 132 |
variable_set('feedburner_replace_html', 1); |
variable_set('feedburner_replace_html', 1); |
| 133 |
variable_set('cache', CACHE_NORMAL); |
variable_set('cache', CACHE_NORMAL); |
| 134 |
$this->drupalGet(''); |
$this->drupalGet(''); |
| 135 |
$this->assertNoRaw(url('rss.xml', array('absolute' => TRUE)), t('Original feed URL not found.')); |
$this->assertNoRaw($original_url, t('Original feed URL not found.')); |
| 136 |
$this->assertRaw(_feedburner_construct_url('example-feed'), t('FeedBurner feed URL found.')); |
$this->assertRaw($feedburner_url, t('FeedBurner feed URL found.')); |
| 137 |
|
|
| 138 |
// Check that the cached page has the replacements. |
// Check that the cached page has the replacements. |
| 139 |
$this->assertTrue(cache_get(url('', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.')); |
$this->assertTrue(cache_get(url('', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.')); |
| 140 |
$this->drupalGet(''); |
$this->drupalGet(''); |
| 141 |
$this->assertNoRaw(url('rss.xml', array('absolute' => TRUE)), t('Original feed URL not found.')); |
$this->assertNoRaw($original_url, t('Original feed URL not found.')); |
| 142 |
$this->assertRaw(_feedburner_construct_url('example-feed'), t('FeedBurner feed URL found.')); |
$this->assertRaw($feedburner_url, t('FeedBurner feed URL found.')); |
| 143 |
} |
} |
| 144 |
|
|
| 145 |
/* function testFeedFlare() { |
/* function testFeedFlare() { |