3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * Test class for CRM_Contact_Page_DedupeException BAO
34 class CRM_Contact_Page_DedupeExceptionTest
extends CiviUnitTestCase
{
37 * Sets up the fixture, for example, opens a network connection.
38 * This method is called before a test is executed.
40 protected function setUp() {
45 * Tears down the fixture, for example, closes a network connection.
47 * This method is called after a test is executed.
49 protected function tearDown() {
53 public function testGetDedupeExceptions() {
54 $contact1 = $this->individualCreate();
55 $contact2 = $this->individualCreate();
56 $exception = $this->callAPISuccess('Exception', 'create', [
57 'contact_id1' => $contact1,
58 'contact_id2' => $contact2,
60 $page = new CRM_Contact_Page_DedupeException();
61 $totalitems = civicrm_api3('Exception', "getcount", []);
63 'total' => $totalitems,
64 'rowCount' => CRM_Utils_Pager
::ROWCOUNT
,
65 'status' => ts('Dedupe Exceptions %%StatusMessage%%'),
66 'buttonBottom' => 'PagerBottomButton',
67 'buttonTop' => 'PagerTopButton',
68 'pageID' => $page->get(CRM_Utils_Pager
::PAGE_ID
),
70 $page->_pager
= new CRM_Utils_Pager($params);
71 $exceptions = $page->getExceptions();
74 'id' => $exception['id'],
75 'contact_id1.display_name' => 'Mr. Anthony Anderson II',
76 'contact_id2.display_name' => 'Mr. Anthony Anderson II',
77 'contact_id1' => $contact1,
78 'contact_id2' => $contact2,
81 $this->assertEquals($expectedArray, $exceptions);