You are here

public function FeedsWebTestCase::getNid in Feeds 7.2

Same name and namespace in other branches
  1. 6 tests/feeds.test \FeedsWebTestCase::getNid()
  2. 7 tests/feeds.test.inc \FeedsWebTestCase::getNid()

Helper function, retrieves node id from a URL.

1 call to FeedsWebTestCase::getNid()
FeedsWebTestCase::createFeedNode in tests/feeds.test
Create a test feed node. Test user has to have sufficient permissions:.

File

tests/feeds.test, line 660
Common functionality for all Feeds tests.

Class

FeedsWebTestCase
Test basic Data API functionality.

Code

public function getNid($url) {
  $matches = array();
  preg_match('/node\\/(\\d+?)$/', $url, $matches);
  $nid = $matches[1];

  // Test for actual integerness.
  $this
    ->assertTrue($nid === (string) (int) $nid, 'Node id is an integer.');
  return $nid;
}