minor changes
authordeb.monish <monish.deb@jmaconsulting.biz>
Fri, 16 Jun 2017 05:14:22 +0000 (10:44 +0530)
committerdeb.monish <monish.deb@jmaconsulting.biz>
Fri, 16 Jun 2017 05:14:22 +0000 (10:44 +0530)
tests/phpunit/CRM/Contact/Page/AjaxTest.php

index d655747d838462fd49e544434882b6e85aa9e818..acc0eb8cfee4ea0a627c75d492bd775afda7dce1 100644 (file)
@@ -262,21 +262,21 @@ class CRM_Contact_Page_AjaxTest extends CiviUnitTestCase {
     );
     CRM_Core_BAO_EntityTag::add($params);
 
-    // CASE I : check the usage count of parent tag which need to be 3
-    //  as it should also include the count of child tags
+    // CASE I : check the usage count of parent tag which need to be 1
+    //  as the one contact added
     $_REQUEST['is_unit_test'] = TRUE;
     $parentTagTreeResult = CRM_Admin_Page_AJAX::getTagTree();
     foreach ($parentTagTreeResult as $result) {
       if ($result['id'] == $parentTag['id']) {
-        $this->assertEquals(3, $result['data']['usages']);
+        $this->assertEquals(1, $result['data']['usages']);
       }
     }
 
-    // CASE 2 : check the usage count of level 1 child tag, which needs to be 2
-    //  as it should also include the count of its child tag
+    // CASE 2 : check the usage count of level 1 child tag, which needs to be 1
+    //  as it should include the count of added one contact
     $_GET['parent_id'] = $parentTag['id'];
     $childTagTree = CRM_Admin_Page_AJAX::getTagTree();
-    $this->assertEquals(2, $childTagTree[0]['data']['usages']);
+    $this->assertEquals(1, $childTagTree[0]['data']['usages']);
 
     // CASE 2 : check the usage count of child tag at level 2
     //which needs to be 1 as it has no child tag