xmlsitemap_menu.test 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * @file
  4. * Unit tests for the xmlsitemap_menu project..
  5. */
  6. /**
  7. * Menu Functional Test.
  8. */
  9. class XMLSitemapMenuFunctionalTest extends XMLSitemapTestHelper {
  10. /**
  11. * Normal User.
  12. *
  13. * @var string
  14. *
  15. * @codingStandardsIgnoreStart
  16. */
  17. protected $normal_user;
  18. /**
  19. * Menu Items.
  20. *
  21. * @var array
  22. */
  23. protected $menu_items = array();
  24. /**
  25. * Get Info.
  26. *
  27. * @codingStandardsIgnoreEnd
  28. */
  29. public static function getInfo() {
  30. return array(
  31. 'name' => 'XML sitemap menu',
  32. 'description' => 'Functional tests for the XML sitemap menu module.',
  33. 'group' => 'XML sitemap',
  34. );
  35. }
  36. /**
  37. * Setup.
  38. */
  39. public function setUp($modules = array()) {
  40. $modules[] = 'xmlsitemap_menu';
  41. $modules[] = 'menu';
  42. parent::setUp($modules);
  43. $this->admin_user = $this->drupalCreateUser(array('administer menu', 'administer xmlsitemap'));
  44. $this->normal_user = $this->drupalCreateUser(array('access content'));
  45. }
  46. /**
  47. * Menu Settings.
  48. */
  49. public function testMenuSettings() {
  50. $this->drupalLogin($this->admin_user);
  51. $edit = array(
  52. 'title' => $this->randomName(),
  53. 'menu_name' => drupal_strtolower($this->randomName()),
  54. 'xmlsitemap[status]' => '1',
  55. 'xmlsitemap[priority]' => '1.0',
  56. );
  57. $this->drupalPost('admin/structure/menu/add', $edit, 'Save');
  58. $this->clickLink('Add link');
  59. $edit = array(
  60. 'link_title' => $this->randomName(),
  61. 'link_path' => 'node',
  62. 'xmlsitemap[status]' => 'default',
  63. 'xmlsitemap[priority]' => 'default',
  64. );
  65. $this->drupalPost(NULL, $edit, 'Save');
  66. }
  67. }