You are here

protected function ContentMigrateTestCase::contentDrupal6Schema in Content Construction Kit (CCK) 7.3

1 call to ContentMigrateTestCase::contentDrupal6Schema()
ContentMigrateTestCase::setUp in modules/content_migrate/tests/content_migrate.test
In the base setUp() method we need to create a content type, and Drupal 6 tables relating to CCK: content_node_field, content_node_field_instance, and content_type_TYPENAME. It is up to a child class to make the proper inserts into these tables.

File

modules/content_migrate/tests/content_migrate.test, line 39
Content Migrate Test Cases

Class

ContentMigrateTestCase
@class Content Migrate Test Case. You should use this as the parent class for your content migrate tests.

Code

protected function contentDrupal6Schema() {
  $schema = array(
    'content_node_field' => array(
      'fields' => array(
        'field_name' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
          'default' => '',
        ),
        'type' => array(
          'type' => 'varchar',
          'length' => 127,
          'not null' => TRUE,
          'default' => '',
        ),
        'global_settings' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => TRUE,
          'serialize' => TRUE,
        ),
        'required' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
        'multiple' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
        'db_storage' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 1,
        ),
        'module' => array(
          'type' => 'varchar',
          'length' => 127,
          'not null' => TRUE,
          'default' => '',
        ),
        'db_columns' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => TRUE,
          'serialize' => TRUE,
        ),
        'active' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
        'locked' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
      ),
      'primary key' => array(
        'field_name',
      ),
    ),
    'content_node_field_instance' => array(
      'fields' => array(
        'field_name' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
          'default' => '',
        ),
        'type_name' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
          'default' => '',
        ),
        'weight' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'label' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => TRUE,
          'default' => '',
        ),
        'widget_type' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => TRUE,
          'default' => '',
        ),
        'widget_settings' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => TRUE,
          'serialize' => TRUE,
        ),
        'display_settings' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => TRUE,
          'serialize' => TRUE,
        ),
        'description' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => TRUE,
        ),
        'widget_module' => array(
          'type' => 'varchar',
          'length' => 127,
          'not null' => TRUE,
          'default' => '',
        ),
        'widget_active' => array(
          'type' => 'int',
          'size' => 'tiny',
          'not null' => TRUE,
          'default' => 0,
        ),
      ),
      'primary key' => array(
        'field_name',
        'type_name',
      ),
    ),
    'content_type_' . $this->content_type->type => array(
      'fields' => array(
        'vid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
        'nid' => array(
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
      ),
      'primary key' => array(
        'vid',
      ),
    ),
  );
  return $schema;
}