You are here

class DataTestCase in Data 8

Same name and namespace in other branches
  1. 6 tests/data.test.inc \DataTestCase
  2. 7 tests/data.test.inc \DataTestCase

Base class for Data module test cases.

Hierarchy

Expanded class hierarchy of DataTestCase

File

tests/data.test.inc, line 10
Contains class definition for Data module test cases.

View source
class DataTestCase extends DrupalWebTestCase {

  /**
   * Return a test schema.
   */
  protected function testSchema() {
    return array(
      'fields' => array(
        'id' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'char0' => array(
          'type' => 'varchar',
          'length' => '255',
          'not null' => FALSE,
          'default' => '',
        ),
        'char1' => array(
          'type' => 'varchar',
          'length' => '255',
          'not null' => FALSE,
          'default' => '',
        ),
      ),
      'indexes' => array(
        'id' => array(
          'id',
        ),
      ),
    );
  }

  /**
   * Test data.
   */
  protected function testData() {
    return array(
      0 => array(
        'id' => 0,
        'char0' => 'test00',
        'char1' => 'test01',
      ),
      1 => array(
        'id' => 1,
        'char0' => 'test10',
        'char1' => 'test11',
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DataTestCase::testData protected function Test data.
DataTestCase::testSchema protected function Return a test schema.