function FieldCrudTestCase::testUpdateNonExistentField

File

modules/field/tests/field.test, line 2719

Class

FieldCrudTestCase

Code

function testUpdateNonExistentField() {
    $test_field = array(
        'field_name' => 'does_not_exist',
        'type' => 'number_decimal',
    );
    try {
        field_update_field($test_field);
        $this->fail(t('Cannot update a field that does not exist.'));
    } catch (FieldException $e) {
        $this->pass(t('Cannot update a field that does not exist.'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.