| [ Index ] |
PHP Cross Reference of Drupal 6 (yi-drupal) |
[Summary view] [Print] [Text view]
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 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Mon Jul 9 18:01:44 2012 | Cross-referenced by PHPXref 0.7 |