Projet

Général

Profil

Paste
Télécharger (1,28 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds_xpathparser / tests / feeds_xpathparser.test @ a2bb1a14

1
<?php
2

    
3
/**
4
 * @file
5
 * Tests for FeedsXPathParserXML.inc.
6
 */
7

    
8
/**
9
 * Test single feeds.
10
 */
11
class FeedsXPathParserWebTestCase extends FeedsWebTestCase {
12

    
13
  /**
14
   * Set up test.
15
   */
16
  public function setUp() {
17
    parent::setUp('feeds_xpathparser');
18

    
19
    // Set the front page to show 30 nodes so we can easily see what is aggregated.
20
    $edit = array('default_nodes_main' => 30);
21
    $this->drupalPost('admin/config/system/site-information', $edit, 'Save configuration');
22

    
23
    // Set the teaser length display to unlimited otherwise tests looking for
24
    // text on nodes will fail.
25
    $edit = array('fields[body][type]' => 'text_default');
26
    $this->drupalPost('admin/structure/types/manage/article/display/teaser', $edit, 'Save');
27

    
28
    // Generalize across my version of feeds and the standard one.
29
    $items = feeds_ui_menu();
30
    if (isset($items['admin/structure/feeds/%feeds_importer/edit'])) {
31
      $this->feeds_base = 'admin/structure/feeds';
32
    }
33
    else {
34
      $this->feeds_base = 'admin/structure/feeds/edit';
35
    }
36
  }
37

    
38
  function postAndCheck($url, $edit, $button, $saved_text) {
39
    $this->drupalPost($url, $edit, $button);
40
    $this->assertText($saved_text);
41
    $this->drupalGet($url);
42
    foreach ($edit as $key => $value) {
43
      $this->assertFieldByName($key, $value);
44
    }
45
  }
46
}