You are here

public function ViewsAtomTestCase::vaNodeInFeed in Views Atom 6

Checks to see if a node is in a given feed

Parameters

$nid: Node id of the node to check

$path: Path of the feed

Return value

bool whether the node exists in the feed or not

1 call to ViewsAtomTestCase::vaNodeInFeed()
ViewsAtomTestCase::test in tests/views_atom.test
views_atom tests

File

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

Class

ViewsAtomTestCase
Tests basic set up for publishing and consuming

Code

public function vaNodeInFeed($nid, $path) {
  $feed = $this
    ->vaFetchFeed($path);
  if (!isset($feed['items'])) {
    return FALSE;
  }
  foreach ($feed['items'] as $item) {
    if (isset($item['rdf']) && isset($item['rdf']['nid']) && $item['rdf']['nid'] == $nid) {
      return TRUE;
    }
  }
  return FALSE;
}