Merge pull request #11712 from jitendrapurohit/CRM-21795
[civicrm-core.git] / tests / phpunit / api / v3 / NavigationTest.php
index 85c69818b6d1434f129a2885e68848dd7d98e642..8cfc2bd4e760c2456667fcf84df39722ae6e9820 100644 (file)
@@ -3,7 +3,7 @@
  * +--------------------------------------------------------------------+
  * | CiviCRM version 4.7                                                |
  * +--------------------------------------------------------------------+
- * | Copyright CiviCRM LLC (c) 2004-2016                                |
+ * | Copyright CiviCRM LLC (c) 2004-2018                                |
  * +--------------------------------------------------------------------+
  * | This file is a part of CiviCRM.                                    |
  * |                                                                    |
@@ -42,6 +42,23 @@ class api_v3_NavigationTest extends CiviUnitTestCase {
     $this->callAPISuccess($this->_entity, 'getsingle', array('label' => 'Manage Groups', 'domain_id' => 1));
   }
 
+  /**
+   * Test get specifying parent
+   */
+  public function testGetByParent() {
+    // get by name
+    $this->callAPISuccess($this->_entity, 'get', array('parentID' => 'Administer', 'domain_id' => 1));
+
+    $params = array(
+      'name' => 'Administer',
+      'domain_id' => 1,
+      'return' => 'id',
+    );
+    $adminId = $this->callAPISuccess($this->_entity, 'getvalue', $params);
+
+    $this->callAPISuccess($this->_entity, 'get', array('parentID' => $adminId, 'domain_id' => 1));
+  }
+
   /**
    * Test create function.
    */