public function FeedsWebTestCase::getNid in Feeds 6
Same name and namespace in other branches
- 7.2 tests/feeds.test \FeedsWebTestCase::getNid()
- 7 tests/feeds.test.inc \FeedsWebTestCase::getNid()
Helper function, retrieves node id from a URL.
2 calls to FeedsWebTestCase::getNid()
- FeedsMapperOGTestCase::testInheritOG in tests/
feeds_mapper_og.test - Test inheriting groups from the feed node.
- FeedsWebTestCase::createFeedNode in tests/
feeds.test - Create a test feed node. Test user has to have sufficient permissions:
File
- tests/
feeds.test, line 349 - 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];
if (!is_numeric($nid)) {
$this
->error(t('Could not find node id, found @nid instead.', array(
'@nid' => $nid,
)));
}
return $nid;
}