6 class CRM_Contact_Page_AjaxTest
extends CiviUnitTestCase
{
9 public function setUp() {
10 $this->useTransaction(TRUE);
15 * Minimal test on the testGetDupes function to make sure it completes without error.
17 public function testGetDedupes() {
19 $_REQUEST['rgid'] = 1;
20 $_REQUEST['columns'] = array(
24 'src' => 'first_name',
30 $_REQUEST['is_unit_test'] = TRUE;
31 $result = CRM_Contact_Page_AJAX
::getDedupes();
32 $this->assertEquals(array('data' => array(), 'recordsTotal' => 0, 'recordsFiltered' => 0), $result);
35 public function testGetDedupesPostCode() {
37 $_REQUEST['rgid'] = 1;
38 $_REQUEST['snippet'] = 4;
39 $_REQUEST['draw'] = 3;
40 $_REQUEST['columns'] = array(
42 'data' => 'is_selected_input',
52 'data' => 'src_image',
74 'data' => 'dst_image',
96 'data' => 'src_email',
107 'data' => 'dst_email',
109 'searchable' => TRUE,
118 'data' => 'src_street',
120 'searchable' => TRUE,
129 'data' => 'dst_street',
131 'searchable' => TRUE,
140 'data' => 'src_postcode',
142 'searchable' => TRUE,
151 'data' => 'dst_postcode',
153 'searchable' => TRUE,
162 'data' => 'conflicts',
164 'searchable' => TRUE,
175 'searchable' => TRUE,
186 'searchable' => TRUE,
187 'orderable' => FALSE,
195 $_REQUEST['start'] = 0;
196 $_REQUEST['length'] = 10;
197 $_REQUEST['search'] = array(
202 $_REQUEST['_'] = 1466478641007;
203 $_REQUEST['Drupal_toolbar_collapsed'] = 0;
204 $_REQUEST['has_js'] = 1;
205 $_REQUEST['SESSa06550b3043ecca303761d968e3c846a'] = 'qxSxw0F_UmBITMM0JaVwTRcHV1bQqBSHNmBMY9AA8Wk';
207 $_REQUEST['is_unit_test'] = TRUE;
209 $result = CRM_Contact_Page_AJAX
::getDedupes();
210 $this->assertEquals(array('data' => array(), 'recordsTotal' => 0, 'recordsFiltered' => 0), $result);