You are here

function FieldCrudTestCase::testUpdateNonExistentField in Drupal 7

File

modules/field/tests/field.test, line 2687
Tests for field.module.

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.'));
  }
}