From df393c14f48287220472273c93e15bad65bf9f54 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 16 Nov 2015 12:55:06 +0530 Subject: [PATCH] CRM-17565 -- Clicking case status link on case dashboard does not open in search correctly --- CRM/Case/Form/Search.php | 4 ++-- tests/phpunit/WebTest/Case/CaseDashboardTest.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CRM/Case/Form/Search.php b/CRM/Case/Form/Search.php index d1c08247db..e5c7918a8f 100644 --- a/CRM/Case/Form/Search.php +++ b/CRM/Case/Form/Search.php @@ -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', diff --git a/tests/phpunit/WebTest/Case/CaseDashboardTest.php b/tests/phpunit/WebTest/Case/CaseDashboardTest.php index 372d120970..67974193a7 100644 --- a/tests/phpunit/WebTest/Case/CaseDashboardTest.php +++ b/tests/phpunit/WebTest/Case/CaseDashboardTest.php @@ -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'); -- 2.25.1