You are here

public function ViewsAtomTestCase::vaFetchFeed in Views Atom 6

Fetch an atom+rdf feed of a given path

Parameters

$path: Path of the feed

Return value

array of the feed's values

2 calls to ViewsAtomTestCase::vaFetchFeed()
ViewsAtomTestCase::test in tests/views_atom.test
views_atom tests
ViewsAtomTestCase::vaNodeInFeed in tests/views_atom.test
Checks to see if a node is in a given feed

File

tests/views_atom.test, line 164
Simple tests for views_atom

Class

ViewsAtomTestCase
Tests basic set up for publishing and consuming

Code

public function vaFetchFeed($path) {
  cache_clear_all('*', 'cache_views', TRUE);
  cache_clear_all('*', 'cache_views_data', TRUE);
  module_load_include('inc', 'feeds_atom', 'libraries/atomrdf_parser');
  $feed = $this
    ->drupalGet($path);
  $this
    ->assertResponse(200, 'Feed exists');
  $feed = atomrdf_parser_parse($feed);
  $this
    ->assertEqual($feed['link'], url($path, array(
    'absolute' => TRUE,
  )), 'Feed seems to output correctly.');
  if (is_array($feed) && isset($feed['items'])) {
    return $feed;
  }
  else {
    return array();
  }
}