From 8b25dde0e6973f34ac510ff378324c610f0b7e48 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 19 Jun 2017 19:57:52 +1200 Subject: [PATCH] CRM-19821 turn action links into relative links. This is to fix the test in the first instance but discussed with Seamus & Monish & both felt that relative links are more correct --- CRM/Core/Action.php | 2 +- tests/phpunit/CRM/Activity/Form/SearchTest.php | 2 +- tests/phpunit/CRM/Financial/Page/AjaxTest.php | 2 +- tests/phpunit/CRM/Group/Page/AjaxTest.php | 14 ++++---------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/CRM/Core/Action.php b/CRM/Core/Action.php index db7393cd65..8be4c9f4e5 100644 --- a/CRM/Core/Action.php +++ b/CRM/Core/Action.php @@ -236,7 +236,7 @@ class CRM_Core_Action { if (isset($link['qs']) && !CRM_Utils_System::isNull($link['qs'])) { $urlPath = CRM_Utils_System::url(self::replace($link['url'], $values), - self::replace($link['qs'], $values), TRUE, NULL, TRUE, $frontend + self::replace($link['qs'], $values), FALSE, NULL, TRUE, $frontend ); } else { diff --git a/tests/phpunit/CRM/Activity/Form/SearchTest.php b/tests/phpunit/CRM/Activity/Form/SearchTest.php index 01044e8a24..8777aa1b32 100644 --- a/tests/phpunit/CRM/Activity/Form/SearchTest.php +++ b/tests/phpunit/CRM/Activity/Form/SearchTest.php @@ -52,7 +52,7 @@ class CRM_Activity_Form_SearchTest extends CiviUnitTestCase { 'source_contact_name' => 'Anderson, Anthony', 'checkbox' => 'mark_x_1', 'mailingId' => '', - 'action' => 'View', + 'action' => 'View', 'campaign' => NULL, 'campaign_id' => NULL, 'repeat' => '', diff --git a/tests/phpunit/CRM/Financial/Page/AjaxTest.php b/tests/phpunit/CRM/Financial/Page/AjaxTest.php index bae26f562a..699ae536d5 100644 --- a/tests/phpunit/CRM/Financial/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Financial/Page/AjaxTest.php @@ -51,7 +51,7 @@ class CRM_Financial_Page_AjaxTest extends CiviUnitTestCase { $json = str_replace(rtrim(CIVICRM_UF_BASEURL, '/'), 'http://FIX ME', $json); $this->assertEquals($json, '{"sEcho": 1, "iTotalRecords": 1, "iTotalDisplayRecords": 1, "aaData": [ ["","","Anderson, Anthony","$ 100.00","12345","' . CRM_Utils_Date::customFormat(date('Ymd')) . ' 12:00 AM",' - . '"Credit Card","Completed","Donation","View"]] }'); } diff --git a/tests/phpunit/CRM/Group/Page/AjaxTest.php b/tests/phpunit/CRM/Group/Page/AjaxTest.php index aad0b9e984..ba9790574c 100644 --- a/tests/phpunit/CRM/Group/Page/AjaxTest.php +++ b/tests/phpunit/CRM/Group/Page/AjaxTest.php @@ -126,22 +126,16 @@ class CRM_Group_Page_AjaxTest extends CiviUnitTestCase { $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); $this->assertEquals(2, $groups['recordsTotal']); - $this->assertEquals('Contacts', $groups['data'][0]['links']); - $this->assertEquals('Contacts', $groups['data'][1]['links']); + $this->assertEquals('Contacts', $groups['data'][0]['links']); + $this->assertEquals('Contacts', $groups['data'][1]['links']); // as per changes made in PR-6822 $this->setPermissionAndRequest(array('view all contacts', 'edit groups')); $params = $this->_params; $groups = CRM_Contact_BAO_Group::getGroupListSelector($params); $this->assertEquals(2, $groups['recordsTotal']); - $this->assertEquals('ContactsSettingsmore', $groups['data'][0]['links']); - $this->assertEquals('ContactsSettingsmore', $groups['data'][1]['links']); + $this->assertEquals('ContactsSettingsmore', $groups['data'][0]['links']); + $this->assertEquals('ContactsSettingsmore', $groups['data'][1]['links']); } /** -- 2.25.1