feeds_xpathparser.test 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * @file
  4. * Tests for FeedsXPathParserXML.inc.
  5. */
  6. /**
  7. * Test single feeds.
  8. */
  9. class FeedsXPathParserWebTestCase extends FeedsWebTestCase {
  10. /**
  11. * Set up test.
  12. */
  13. public function setUp() {
  14. parent::setUp('feeds_xpathparser');
  15. // Set the front page to show 30 nodes so we can easily see what is aggregated.
  16. $edit = array('default_nodes_main' => 30);
  17. $this->drupalPost('admin/config/system/site-information', $edit, 'Save configuration');
  18. // Set the teaser length display to unlimited otherwise tests looking for
  19. // text on nodes will fail.
  20. $edit = array('fields[body][type]' => 'text_default');
  21. $this->drupalPost('admin/structure/types/manage/article/display/teaser', $edit, 'Save');
  22. // Generalize across my version of feeds and the standard one.
  23. $items = feeds_ui_menu();
  24. if (isset($items['admin/structure/feeds/%feeds_importer/edit'])) {
  25. $this->feeds_base = 'admin/structure/feeds';
  26. }
  27. else {
  28. $this->feeds_base = 'admin/structure/feeds/edit';
  29. }
  30. }
  31. function postAndCheck($url, $edit, $button, $saved_text) {
  32. $this->drupalPost($url, $edit, $button);
  33. $this->assertText($saved_text);
  34. $this->drupalGet($url);
  35. foreach ($edit as $key => $value) {
  36. $this->assertFieldByName($key, $value);
  37. }
  38. }
  39. }