You are here

function PhoneNumberContentCrudTest::testPhoneNumberCreateFieldAPI in Phone Number 6

All we're doing here is creating a content type, creating a simple cck_phone field on that content type, and making sure said field exists in the database.

File

tests/cck_phone.crud.test, line 31
Basic CRUD simpletests for the cck_phone module, based off of content.crud.test in CCK.

Class

PhoneNumberContentCrudTest

Code

function testPhoneNumberCreateFieldAPI() {
  $this
    ->acquireContentTypes(1);
  $field = $this
    ->createField(array(
    'type' => 'phone_number',
    'widget_type' => 'phone_number',
  ), 0);

  //$this->pass(print_r($this->content_types, TRUE));

  //$this->pass(print_r($field, TRUE));
  $table_schema = drupal_get_schema();

  //$this->pass(print_r(array_keys($table_schema), TRUE));

  // Check the schema - the values should be in the per-type table.
  $this
    ->assertSchemaMatchesTables(array(
    'per_type' => array(
      $this->content_types[0]->type => array(
        $field['field_name'] => array(
          'number',
          'country_codes',
          'extension',
        ),
      ),
    ),
  ));
}