Update Unit test styling to cover the future coder version
[civicrm-core.git] / tests / phpunit / CRM / Case / BAO / QueryTest.php
1 <?php
2
3 /**
4 * Include dataProvider for tests
5 * @group headless
6 */
7 class CRM_Case_BAO_QueryTest extends CiviUnitTestCase {
8
9 /**
10 * Set up function.
11 *
12 * Ensure CiviCase is enabled.
13 */
14 public function setUp() {
15 parent::setUp();
16 CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase');
17 }
18
19 /**
20 * Check that Qill is calculated correctly.
21 *
22 * CRM-17120 check the qill is still calculated after changing function used
23 * to retrieve function.
24 *
25 * Note that the Qill doesn't actually appear to have the correct labels to
26 * start with. I didn't attempt to fix that. I just prevented regression.
27 *
28 * I could not find anyway to actually do this search with the relevant fields
29 * as parameters & don't know if they exist as legitimate code or code cruft so
30 * this test was the only way I could verify the change.
31 * - case_recent_activity_type
32 * - case_activity_status_id
33 * - case_activity_medium_id
34 */
35 public function testWhereClauseSingle() {
36 $params = array(
37 0 => array(
38 0 => 'case_recent_activity_type',
39 1 => '=',
40 2 => 6,
41 3 => 1,
42 4 => 0,
43 ),
44 1 => array(
45 0 => 'case_activity_status_id',
46 1 => '=',
47 2 => 1,
48 3 => 1,
49 4 => 0,
50 ),
51 2 => array(
52 0 => 'case_activity_medium_id',
53 1 => '=',
54 2 => 1,
55 3 => 1,
56 4 => 0,
57 ),
58 );
59
60 $queryObj = new CRM_Contact_BAO_Query($params, NULL, NULL, FALSE, FALSE, CRM_Contact_BAO_Query::MODE_CASE);
61 $this->assertEquals(array(
62 0 => 'Activity Type = Contribution',
63 1 => 'Activity Type = Scheduled',
64 2 => 'Activity Medium = In Person',
65 ),
66 $queryObj->_qill[1]
67 );
68 }
69
70 }