/** * Gets the node ID of the last created node. * * This should only be called just after a node has been saved and we're on the node view page (such as node/1337). * * @param WebInterface $I * A reference to the Actor object being used. * * @return mixed * $nid from from node edit tab, or null if not found. */ public function grabLastCreatedNid($I) { // Grab the node id from the Edit tab once the node has been saved. $edit_url = $I->grabAttributeFrom(Page::$nodeEditTabLinkSelector, 'href'); $matches = array(); if (preg_match('~/node/(\\d+)/edit~', $edit_url, $matches)) { return $matches[1]; } return null; }