1 file.test | FileTestHelper::removeNodeFile($nid, $new_revision = TRUE) |
Removes a file from a node.
Note that if replacing a file, it must first be removed then added again.
Parameters
int $nid: Node ID.
bool $new_revision: If TRUE, create a new revision.
File
- core/
modules/ file/ tests/ file.test, line 328 - Tests for file.module.
Class
- FileTestHelper
- Provides methods specifically for testing File module's field handling.
Code
function removeNodeFile($nid, $new_revision = TRUE) {
$edit = array(
'revision' => (string) (int) $new_revision,
);
$this->backdropPost('node/' . $nid . '/edit', array(), t('Remove'));
$this->backdropPost(NULL, $edit, t('Save'));
}