You are here

public function WebformGeneralTestCase::webformRecordExists in Webform 7.4

Same name and namespace in other branches
  1. 6.3 tests/webform.test \WebformGeneralTestCase::webformRecordExists()
  2. 7.3 tests/webform.test \WebformGeneralTestCase::webformRecordExists()

Determine whether a Webform record exists for a given nid.

Parameters

int $nid: The node ID.

Return value

bool Whether or not the Webform record exists.

2 calls to WebformGeneralTestCase::webformRecordExists()
WebformGeneralTestCase::testWebformCreate in tests/WebformGeneralTestCase.test
Test creating a new Webform node.
WebformGeneralTestCase::testWebformCreateNewType in tests/WebformGeneralTestCase.test
Test webform-enabling a different node type and testing behavior.

File

tests/WebformGeneralTestCase.test, line 91

Class

WebformGeneralTestCase
Test general functionality of Webform.

Code

public function webformRecordExists($nid) {
  return (bool) db_query("SELECT nid FROM {webform} WHERE nid = :nid", array(
    ':nid' => $nid,
  ))
    ->fetchField();
}