summaryrefslogtreecommitdiff
path: root/modules/simpletest/tests/module_test.install
blob: 5f8e76b702ea06febb8b912753570a3f0762d8ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
// $Id$

/**
 * @file
 * Install, update and uninstall functions for the module_test module.
 */

/**
 * Implements hook_schema().
 */
function module_test_schema() {
  $schema['module_test'] = array(
    'description' => 'Dummy table to test the behavior of hook_schema() during module installation.',
    'fields' => array(
      'data' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'An example data column for the module.',
      ),
    ),
  );
  return $schema;
}

/**
 * Implements hook_install().
 */
function module_test_install() {
  $record = array('data' => 'Data inserted in hook_install()');
  drupal_write_record('module_test', $record);
}

/**
 * Implements hook_enable().
 */
function module_test_enable() {
  $record = array('data' => 'Data inserted in hook_enable()');
  drupal_write_record('module_test', $record);
}