X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FCRM%2FDedupe%2FDedupeFinderTest.php;h=0e5f599a35c31a3a924771629e0e172565bc516f;hb=24fe2053c80c74dc9e97d1d2edb4eca34d4d4784;hp=0666a70854c47071e023147ff864ed3e5970407b;hpb=8607181634818e76e8aba03ede983ac1e7c16ffa;p=civicrm-core.git diff --git a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php index 0666a70854..0e5f599a35 100644 --- a/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php +++ b/tests/phpunit/CRM/Dedupe/DedupeFinderTest.php @@ -22,6 +22,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Clean up after the test. + * + * @throws \CRM_Core_Exception */ public function tearDown() { @@ -60,6 +62,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Test duplicate contact retrieval with 2 email fields. + * + * @throws \CRM_Core_Exception */ public function testUnsupervisedWithTwoEmailFields() { $this->setupForGroupDedupe(); @@ -84,6 +88,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { * Test that a rule set to is_reserved = 0 works. * * There is a different search used dependent on this variable. + * + * @throws \CRM_Core_Exception */ public function testCustomRule() { $this->setupForGroupDedupe(); @@ -113,6 +119,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Test a custom rule with a non-default field. + * + * @throws \CRM_Core_Exception */ public function testCustomRuleWithAddress() { $this->setupForGroupDedupe(); @@ -142,6 +150,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Test rule from Richard + * + * @throws \CRM_Core_Exception */ public function testRuleThreeContactFieldsEqualWeightWIthThresholdtheTotalSumOfAllWeight() { $this->setupForGroupDedupe(); @@ -164,11 +174,13 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { ]); } $foundDupes = CRM_Dedupe_Finder::dupesInGroup($ruleGroup['id'], $this->groupID); - $this->assertEquals(1, count($foundDupes)); + $this->assertCount(1, $foundDupes); } /** * Test a custom rule with a non-default field. + * + * @throws \CRM_Core_Exception */ public function testInclusiveRule() { $this->setupForGroupDedupe(); @@ -191,7 +203,7 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { ]); } $foundDupes = CRM_Dedupe_Finder::dupesInGroup($ruleGroup['id'], $this->groupID); - $this->assertEquals(4, count($foundDupes)); + $this->assertCount(4, $foundDupes); CRM_Dedupe_Finder::dupes($ruleGroup['id']); } @@ -215,6 +227,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Test dupesByParams function. + * + * @throws \CRM_Core_Exception */ public function testDupesByParams() { // make dupe checks based on based on following contact sets: @@ -346,6 +360,8 @@ class CRM_Dedupe_DedupeFinderTest extends CiviUnitTestCase { /** * Set up a group of dedupable contacts. + * + * @throws \CRM_Core_Exception */ protected function setupForGroupDedupe() { $params = [