add rest of navigation BAO to help satisfy syntax conformance test
authoreileenmcnaugton <eileen@fuzion.co.nz>
Thu, 10 Sep 2015 22:09:47 +0000 (10:09 +1200)
committereileenmcnaugton <eileen@fuzion.co.nz>
Wed, 30 Sep 2015 01:23:17 +0000 (14:23 +1300)
tests/phpunit/CRM/Core/BAO/NavigationTest.php

index 6097a1e33bdc322266c046c6cdd9a89ff9a16160..900461857b267883f48b2533f69aa656d98bf65d 100644 (file)
@@ -13,7 +13,7 @@ class CRM_Core_BAO_NavigationTest extends CiviUnitTestCase {
    */
   public function setUp() {
     parent::setUp();
-    CRM_Core_BAO_Navigation::rebuildReportsNavigation();
+    CRM_Core_BAO_Navigation::rebuildReportsNavigation(CRM_Core_Config::domainID());
   }
 
   /**
@@ -23,24 +23,7 @@ class CRM_Core_BAO_NavigationTest extends CiviUnitTestCase {
     $reportCount = $this->getCountReportInstances();
     CRM_Core_DAO::executeQuery("DELETE FROM civicrm_navigation WHERE url = 'civicrm/report/instance/1?reset=1'");
     $this->assertEquals($reportCount - 1, $this->getCountReportInstances());
-    CRM_Core_BAO_Navigation::rebuildReportsNavigation();
-
-    $this->assertEquals($reportCount, $this->getCountReportInstances());
-    $url = 'civicrm/report/instance/1';
-    $url_params = 'reset=1';
-    $new_nav = CRM_Core_BAO_Navigation::getNavItemByUrl($url, $url_params);
-    $this->assertObjectHasAttribute('id', $new_nav);
-    $this->assertNotNull($new_nav->id);
-  }
-
-  /**
-   * Test that a missing report menu link is added by rebuildReportsNavigation.
-   */
-  public function testCreateMissingReportMenuItemLinkViaAPI() {
-    $reportCount = $this->getCountReportInstances();
-    CRM_Core_DAO::executeQuery("DELETE FROM civicrm_navigation WHERE url = 'civicrm/report/instance/1?reset=1'");
-    $this->assertEquals($reportCount - 1, $this->getCountReportInstances());
-    $this->callAPISuccess('Navigation', 'reset', array('for' => 'report'));
+    CRM_Core_BAO_Navigation::rebuildReportsNavigation(CRM_Core_Config::domainID());
 
     $this->assertEquals($reportCount, $this->getCountReportInstances());
     $url = 'civicrm/report/instance/1';
@@ -62,7 +45,7 @@ class CRM_Core_BAO_NavigationTest extends CiviUnitTestCase {
     $this->assertNotEquals(FALSE, $existing_nav);
     $existing_nav->parent_id = 1;
     $existing_nav->save();
-    CRM_Core_BAO_Navigation::rebuildReportsNavigation();
+    CRM_Core_BAO_Navigation::rebuildReportsNavigation(CRM_Core_Config::domainID());
     $parent_url = 'civicrm/report/list';
     $parent_url_params = 'compid=99&reset=1';
     $parent_nav = CRM_Core_BAO_Navigation::getNavItemByUrl($parent_url, $parent_url_params);