/[drupal]/contributions/modules/biblio/tests/biblio.test
ViewVC logotype

Diff of /contributions/modules/biblio/tests/biblio.test

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.1 by rjerome, Mon Nov 16 02:24:22 2009 UTC revision 1.1.2.2 by rjerome, Tue Nov 17 03:28:09 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id$  // $Id: biblio.test,v 1.1.2.1 2009/11/16 02:24:22 rjerome Exp $
3  /*  /*
4   * @file   * @file
5   * Base class for all biblio tests   * Base class for all biblio tests
# Line 37  class BiblioWebTestCase extends DrupalWe Line 37  class BiblioWebTestCase extends DrupalWe
37      parent::tearDown();      parent::tearDown();
38    }    }
39    
40    function createNode() {    function createNode($type = 100) {
41        $schema = drupal_get_schema('biblio');
42        foreach($schema['fields'] as $name => $values) {
43          if ($values['type'] == 'int') continue;
44          switch ($values['type']) {
45            case 'varchar':
46              $length = $values['length'];
47              break;
48            case 'text':
49              $length = 1000;
50              break;
51          }
52          $biblio_fields["$name"] = $name;
53        }
54      $settings = array(      $settings = array(
55          'title' => array(FIELD_LANGUAGE_NONE => array(array('value' => 'Biblio Title'))),
56        'type' => 'biblio', // This replaces the default type        'type' => 'biblio', // This replaces the default type
57        'biblio_type' => 100, // This appends a new field.        'biblio_type' => $type, // This appends a new field.
58        'biblio_year' => 2009,        'biblio_year' => 2009,
       'biblio_contributors' => array()  
59      );      );
60      $node =  $this->drupalCreateNode($settings);      $settings = array_merge($biblio_fields, $settings);
61    
62        $node = $this->drupalCreateNode($settings);
63        $node->biblio_contributors[1][] = array('name' => 'Ron J. Jeromezzzzzz',  'auth_type' => 1);
64        $node->biblio_contributors[1][] = array('name' => 'John Smithzzzzzz',     'auth_type' => 1);
65        $node->biblio_contributors[1][] = array('name' => 'George W. Bushzzzzzz', 'auth_type' => 1);
66        biblio_insert_contributors($node);
67        $node = node_load($node->nid, NULL, TRUE);
68        foreach($node->biblio_contributors[1] as $author) {
69          $this->cids[] = $author['cid'];
70        }
71    
72      $this->nids[] = $node->nid;      $this->nids[] = $node->nid;
73    
74      return $node;      return $node;

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

  ViewVC Help
Powered by ViewVC 1.1.3