xmlsitemap_menu.test 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * @file
  4. * Unit tests for the xmlsitemap_menu module.
  5. */
  6. class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
  7. protected $normal_user;
  8. protected $menu_items = array();
  9. public static function getInfo() {
  10. return array(
  11. 'name' => 'XML sitemap menu',
  12. 'description' => 'Functional tests for the XML sitemap menu module.',
  13. 'group' => 'XML sitemap',
  14. );
  15. }
  16. function setUp($modules = array()) {
  17. $modules[] = 'xmlsitemap_menu';
  18. $modules[] = 'menu';
  19. parent::setUp($modules);
  20. $this->admin_user = $this->drupalCreateUser(array('administer menu', 'administer xmlsitemap'));
  21. $this->normal_user = $this->drupalCreateUser(array('access content'));
  22. }
  23. function testMenuSettings() {
  24. $this->drupalLogin($this->admin_user);
  25. $edit = array(
  26. 'title' => $this->randomName(),
  27. 'menu_name' => drupal_strtolower($this->randomName()),
  28. 'xmlsitemap[status]' => '1',
  29. 'xmlsitemap[priority]' => '1.0',
  30. );
  31. $this->drupalPost('admin/structure/menu/add', $edit, 'Save');
  32. $menu = menu_load($edit['menu_name']);
  33. $this->clickLink('Add link');
  34. $edit = array(
  35. 'link_title' => $this->randomName(),
  36. 'link_path' => 'node',
  37. 'xmlsitemap[status]' => 'default',
  38. 'xmlsitemap[priority]' => 'default',
  39. );
  40. $this->drupalPost(NULL, $edit, 'Save');
  41. }
  42. }