Skip to content
Snippets Groups Projects
Unverified Commit bd5f58a4 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #17616 from demeritcowboy/xml-acttype-more-more

#1433 - Replace last instances of calls to CRM_Case_XMLProcessor::allActivityTypes()
parents 26a20a22 7646baed
Branches
Tags
No related merge requests found
......@@ -404,7 +404,7 @@ AND a.is_deleted = 0
*/
public function createActivity($activityTypeXML, &$params) {
$activityTypeName = (string) $activityTypeXML->name;
$activityTypes = &$this->allActivityTypes(TRUE, TRUE);
$activityTypes = CRM_Case_PseudoConstant::caseActivityType(TRUE, TRUE);
$activityTypeInfo = $activityTypes[$activityTypeName] ?? NULL;
if (!$activityTypeInfo) {
......
......@@ -771,7 +771,7 @@ LIMIT 1
$activityTypes = $form->getActivityTypes($xml, $activitySetName);
}
else {
$activityTypes = CRM_Case_XMLProcessor::allActivityTypes(FALSE, TRUE);
$activityTypes = CRM_Case_PseudoConstant::caseActivityType(FALSE, TRUE);
}
if (!$activityTypes) {
......
<?php
require_once 'CiviTest/CiviCaseTestCase.php';
/**
* Class CRM_Case_Form_SearchTest
* @group headless
*/
class CRM_Case_Form_SearchTest extends CiviCaseTestCase {
public function setUp() {
parent::setUp();
$this->quickCleanup(['civicrm_case_contact', 'civicrm_case', 'civicrm_contact']);
}
/**
* Similar to tests in CRM_Core_FormTest where it's just testing there's no
* red boxes when you open the form, but it requires CiviCase to be
* enabled so putting in a separate place.
*
* This doesn't test much expected output just that the page opens without
* notices or errors. For example to make it fail change the spelling of a
* variable so it has a typo in CRM_Case_Form_Search::preProcess(), and then
* this test will throw an exception.
*/
public function testOpeningFindCaseForm() {
$form = new CRM_Case_Form_Search();
$form->controller = new CRM_Case_Controller_Search('Find Cases');
ob_start();
$form->controller->_actions['display']->perform($form, 'display');
$contents = ob_get_contents();
ob_end_clean();
// There's a bunch of other stuff we could check for in $contents, but then
// it's tied to the html output and has the same maintenance problems
// as webtests. Mostly what we're doing in this test is checking that it
// doesn't generate any E_NOTICES/WARNINGS or other errors. But let's do
// one check.
$this->assertContains('<label for="case_id">', $contents);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment