CRM-17565 -- Clicking case status link on case dashboard does not open in search...
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 16 Nov 2015 07:25:06 +0000 (12:55 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Mon, 16 Nov 2015 07:25:06 +0000 (12:55 +0530)
CRM/Case/Form/Search.php
tests/phpunit/WebTest/Case/CaseDashboardTest.php

index d1c08247db68454b2210863eaab66d77384e0c28..e5c7918a8fa1d3655edb5f911fbd08f8948e0b4f 100644 (file)
@@ -383,8 +383,8 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search {
       CRM_Core_DAO::$_nullObject
     );
     if ($caseType) {
-      $this->_formValues['case_type_id'][$caseType] = 1;
-      $this->_defaults['case_type_id'][$caseType] = 1;
+      $this->_formValues['case_type_id'] = $caseType;
+      $this->_defaults['case_type_id'] = $caseType;
     }
 
     $caseFromDate = CRM_Utils_Request::retrieve('pstart', 'Date',
index 372d120970915a03be9749b7b6b0b4ac612552d5..67974193a739aa880847afa925fbfe8cab26455e 100644 (file)
@@ -77,7 +77,7 @@ class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase {
     $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
 
     // We're using pop-up New Contact dialog
-    $this->createDialogContact('client_id');
+    $params = $this->createDialogContact('client_id');
 
     // Fill in other form values. We'll use a case type which is included in CiviCase sample data / xml files.
     $caseTypeLabel = "Adult Day Care Referral";
@@ -108,6 +108,12 @@ class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase {
     // Is status message correct?
     $this->waitForText('crm-notification-container', "Case opened successfully.");
 
+    // Go back to dashboard
+    $this->openCiviPage('case', 'reset=1');
+    //Check whether case status link opens in search correctly
+    $this->clickLink("xpath=//table[@class='report']/tbody/tr[3]/td/a");
+    $this->assertElementContainsText('Search', "{$params['last_name']}, {$params['first_name']}");
+
     // Go back to dashboard
     $this->openCiviPage('case', 'reset=1');