[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/link/tests/ -> link.crud.test (source)

   1  <?php
   2  // $Id: link.crud.test,v 1.1.4.4 2010/01/28 03:18:30 jcfiala Exp $
   3  
   4  /**
   5   * @file
   6   * Basic CRUD simpletests for the link module, based off of content.crud.test in CCK.
   7   */
   8  
   9  // Need to include content.crud.test so we can inherit from it's ContentCrudTestCase.
  10  require_once(drupal_get_path('module', 'content') .'/tests/content.crud.test');
  11  
  12  class LinkContentCrudTest extends ContentCrudTestCase {
  13    
  14    function getInfo() {
  15      return array(
  16        'name' => t('Link CRUD - Basic API tests'),
  17        'description' => t('Tests the field CRUD (create, read, update, delete) API. <strong>Requires <a href="@schema_link">Schema module</a>.</strong>', array('@schema_link' => 'http://www.drupal.org/project/schema')),
  18        'group' => t('Link'),
  19      );
  20    }
  21    
  22    function setUp() {
  23      parent::setUp('link'); 
  24      $this->loginWithPermissions();
  25    }
  26    
  27    /**
  28     * All we're doing here is creating a content type, creating a simple link field
  29     * on that content type, and making sure said field exists in the database.
  30     */
  31    function testLinkCreateFieldAPI() {
  32      $this->acquireContentTypes(1);
  33      
  34      $field = $this->createField(array('type' => 'link', 'widget_type' => 'link'), 0);
  35      
  36      //$this->pass(print_r($this->content_types, TRUE));
  37      //$this->pass(print_r($field, TRUE));
  38      
  39      $table_schema = drupal_get_schema();
  40      //$this->pass(print_r(array_keys($table_schema), TRUE));
  41      // Check the schema - the values should be in the per-type table.
  42      $this->assertSchemaMatchesTables(array(
  43        'per_type' => array(
  44          $this->content_types[0]->type => array($field['field_name'] => array('url', 'title', 'attributes')),
  45        ),
  46      ));
  47    }
  48    
  49  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7