dotModuleTest.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Tests\tripal_jbrowse_page;
  3. use StatonLab\TripalTestSuite\DBTransaction;
  4. use StatonLab\TripalTestSuite\TripalTestCase;
  5. class dotModuleTest extends TripalTestCase {
  6. // Uncomment to auto start and rollback db transactions per test method.
  7. use DBTransaction;
  8. /**
  9. * Tests tripal_jbrowse_page_menu().
  10. */
  11. public function testHookMenu() {
  12. $menu_items = tripal_jbrowse_page_menu();
  13. foreach ($menu_items as $path => $item) {
  14. // First ensure there are all the menu item keys required.
  15. $this->assertArrayHasKey('title', $item);
  16. $this->assertArrayHasKey('description', $item);
  17. $this->assertArrayHasKey('page callback', $item);
  18. $this->assertArrayHasKey('type', $item);
  19. $this->assertArrayHasKey('access arguments', $item);
  20. // Check that all jbrowse instance paths are the correct type.
  21. $path_parts = explode('/', $path);
  22. if (($path_parts[0] == 'jbrowse') && (sizeof($path_parts) > 1)) {
  23. $this->assertEquals(MENU_SUGGESTED_ITEM, $item['type']);
  24. }
  25. }
  26. }
  27. }