From a15773dbe01c45a8441d8fa224b5046d7c6b2ac8 Mon Sep 17 00:00:00 2001 From: Tim Mallezie Date: Thu, 21 May 2015 07:50:07 +0200 Subject: [PATCH] remove more inline messages --- .../phpunit/CRM/Activity/BAO/ActivityTest.php | 8 ++-- .../BAO/ContactType/ContactSearchTest.php | 38 ++++++++--------- .../Contact/BAO/ContactType/ContactTest.php | 22 +++++----- .../BAO/ContactType/ContactTypeTest.php | 40 +++++++++--------- .../BAO/ContactType/RelationshipTest.php | 24 +++++------ tests/phpunit/CRM/Contact/BAO/QueryTest.php | 2 +- .../Contact/Form/Search/Custom/GroupTest.php | 4 +- .../phpunit/CRM/Event/BAO/ParticipantTest.php | 2 +- tests/phpunit/CRM/Mailing/BAO/QueryTest.php | 2 +- .../CRM/Member/Form/MembershipTest.php | 6 +-- tests/phpunit/api/v3/AddressTest.php | 2 +- tests/phpunit/api/v3/CaseTypeTest.php | 4 +- tests/phpunit/api/v3/ContactTest.php | 6 +-- tests/phpunit/api/v3/ContributionSoftTest.php | 30 ++++++------- tests/phpunit/api/v3/CustomFieldTest.php | 2 +- tests/phpunit/api/v3/CustomGroupTest.php | 4 +- tests/phpunit/api/v3/EmailTest.php | 4 +- tests/phpunit/api/v3/EventTest.php | 4 +- tests/phpunit/api/v3/GrantTest.php | 4 +- tests/phpunit/api/v3/MembershipTypeTest.php | 4 +- tests/phpunit/api/v3/NoteTest.php | 8 ++-- tests/phpunit/api/v3/ParticipantTest.php | 2 +- tests/phpunit/api/v3/PriceFieldTest.php | 4 +- tests/phpunit/api/v3/PriceFieldValueTest.php | 4 +- .../api/v3/TaxContributionPageTest.php | 42 +++++++++---------- tests/phpunit/api/v3/UFJoinTest.php | 2 +- 26 files changed, 137 insertions(+), 137 deletions(-) diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 8e90f5a3af..d5f663a644 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -298,7 +298,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities // 8 schedule activities that should be shown on dashboard $count = 8; - $this->assertEquals($count, $activityCount, 'In line ' . __LINE__); + $this->assertEquals($count, $activityCount); } /** @@ -328,7 +328,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // 5 activities ( 2 scheduled, 3 Completed ), note that dashboard shows only scheduled activities $count = 2; - $this->assertEquals($count, $activityCount, 'In line ' . __LINE__); + $this->assertEquals($count, $activityCount); } /** @@ -357,7 +357,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // 5 activities, Contact Summary should show all activities $count = 5; - $this->assertEquals($count, $activityCount, 'In line ' . __LINE__); + $this->assertEquals($count, $activityCount); } /** @@ -385,7 +385,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { //since we are loading activities from dataset, we know total number of activities for this contact // this contact does not have any activity - $this->assertEquals(0, $activityCount, 'In line ' . __LINE__); + $this->assertEquals(0, $activityCount); } /** diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php index 492d62dbab..f3630b9da6 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php @@ -101,19 +101,19 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $indiviParent = $result['values'][$this->indiviParent]; //asserts for type:Individual - $this->assertEquals($individual['contact_id'], $this->individual, 'In line ' . __LINE__); + $this->assertEquals($individual['contact_id'], $this->individual); $this->assertEquals($individual['first_name'], $this->indiviParams['first_name']); $this->assertEquals($individual['contact_type'], $this->indiviParams['contact_type']); $this->assertNotContains('contact_sub_type', $individual); //asserts for type:Individual subtype:Student - $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__); + $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent); $this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']); $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']); $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']); //asserts for type:Individual subtype:Parent - $this->assertEquals($indiviParent['contact_id'], $this->indiviParent, 'In line ' . __LINE__); + $this->assertEquals($indiviParent['contact_id'], $this->indiviParent); $this->assertEquals($indiviParent['first_name'], $this->indiviParentParams['first_name']); $this->assertEquals($indiviParent['contact_type'], $this->indiviParentParams['contact_type']); $this->assertEquals(end($indiviParent['contact_sub_type']), $this->indiviParentParams['contact_sub_type']); @@ -126,13 +126,13 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $orgSponsor = $result['values'][$this->orgSponsor]; //asserts for type:Organization - $this->assertEquals($organization['contact_id'], $this->organization, 'In line ' . __LINE__); + $this->assertEquals($organization['contact_id'], $this->organization); $this->assertEquals($organization['organization_name'], $this->organizationParams['organization_name']); $this->assertEquals($organization['contact_type'], $this->organizationParams['contact_type']); $this->assertNotContains('contact_sub_type', $organization); //asserts for type:Organization subtype:Sponsor - $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__); + $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor); $this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']); $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']); $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']); @@ -144,7 +144,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $household = $result['values'][$this->household]; //asserts for type:Household - $this->assertEquals($household['contact_id'], $this->household, 'In line ' . __LINE__); + $this->assertEquals($household['contact_id'], $this->household); $this->assertEquals($household['household_name'], $this->householdParams['household_name']); $this->assertEquals($household['contact_type'], $this->householdParams['contact_type']); $this->assertNotContains('contact_sub_type', $household); @@ -164,7 +164,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $indiviStudent = $result['values'][$this->indiviStudent]; //asserts for type:Individual subtype:Student - $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__); + $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent); $this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']); $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']); $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']); @@ -184,7 +184,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $orgSponsor = $result['values'][$this->orgSponsor]; //asserts for type:Organization subtype:Sponsor - $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__); + $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor); $this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']); $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']); $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']); @@ -212,7 +212,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $indiviStudent = $result['values'][$this->indiviStudent]; //asserts for type:Individual subtype:Student - $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__); + $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent); $this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']); $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']); $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']); @@ -232,7 +232,7 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $orgSponsor = $result['values'][$this->orgSponsor]; //asserts for type:Organization subtype:Sponsor - $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__); + $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor); $this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']); $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']); $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']); @@ -253,27 +253,27 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { // for invalid type $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for invalid subtype $params = array('contact_sub_type' => 'Invalid', 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for invalid contact type as well as subtype $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for valid type and invalid subtype $params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for invalid type and valid subtype $params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'indivi_student', 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); } /** @@ -285,22 +285,22 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { $defaults = array(); $params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3); $result = civicrm_api('contact', 'get', $params); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for type:Orgaization subtype:Parent $params = array('contact_type' => 'Orgaization' . CRM_Core_DAO::VALUE_SEPARATOR . $this->parent, 'version' => 3); $result = civicrm_api('contact', 'get', $params, $defaults); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for type:Household subtype:Sponsor $params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3); $result = civicrm_api('contact', 'get', $params, $defaults); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); // for type:Household subtype:Student $params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->student, 'version' => 3); $result = civicrm_api('contact', 'get', $params, $defaults); - $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result['values']), TRUE); } } diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php index efc64f23e0..77a50ece78 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php @@ -121,7 +121,7 @@ DELETE FROM civicrm_contact_type } $this->assertEquals($contact->first_name, 'Bill'); $this->assertEquals($contact->contact_type, 'Individual'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->student, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->student); CRM_Contact_BAO_Contact::deleteContact($contact->id); //check for Type:Organization, Subtype:Sponsor @@ -137,7 +137,7 @@ DELETE FROM civicrm_contact_type } $this->assertEquals($contact->organization_name, 'Conservation Corp'); $this->assertEquals($contact->contact_type, 'Organization'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->sponsor); CRM_Contact_BAO_Contact::deleteContact($contact->id); } @@ -167,9 +167,9 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); + $this->assertEquals($updatedContact->id, $contact->id); $this->assertEquals($updatedContact->contact_type, 'Individual'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student); CRM_Contact_BAO_Contact::deleteContact($contact->id); $params = array( @@ -192,9 +192,9 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); + $this->assertEquals($updatedContact->id, $contact->id); $this->assertEquals($updatedContact->contact_type, 'Organization'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor); CRM_Contact_BAO_Contact::deleteContact($contact->id); } @@ -225,9 +225,9 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); + $this->assertEquals($updatedContact->id, $contact->id); $this->assertEquals($updatedContact->contact_type, 'Individual'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent); CRM_Contact_BAO_Contact::deleteContact($contact->id); $params = array( @@ -252,9 +252,9 @@ DELETE FROM civicrm_contact_type catch (Exception$expected) { } - $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); + $this->assertEquals($updatedContact->id, $contact->id); $this->assertEquals($updatedContact->contact_type, 'Organization'); - $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team, 'In line ' . __LINE__); + $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team); CRM_Contact_BAO_Contact::deleteContact($contact->id); $params = array( @@ -280,7 +280,7 @@ DELETE FROM civicrm_contact_type catch (Exception$expected) { } - $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); + $this->assertEquals($updatedContact->id, $contact->id); $this->assertEquals($updatedContact->contact_type, 'Individual'); $this->assertEquals($updatedContact->contact_sub_type, 'null'); CRM_Contact_BAO_Contact::deleteContact($contact->id); diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php index ed6d0261f4..fb5081a3a8 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php @@ -63,7 +63,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { $contactTypes = array('Individual', 'Organization', 'Household'); $result = CRM_Contact_BAO_ContactType::contactTypes('Individual'); foreach ($contactTypes as $type) { - $this->assertEquals(in_array($type, $result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(in_array($type, $result), TRUE); } // check for type:Individual @@ -71,44 +71,44 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { foreach ($result as $subtype) { $subTypeName = in_array($subtype, $this->subTypesIndividual); if (!empty($subTypeName)) { - $this->assertEquals($subTypeName, TRUE, 'In line ' . __LINE__); + $this->assertEquals($subTypeName, TRUE); } - $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE, 'In line ' . __LINE__); - $this->assertEquals(in_array($subtype, $this->subTypesHousehold), FALSE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE); + $this->assertEquals(in_array($subtype, $this->subTypesHousehold), FALSE); } // check for type:Organization $result = CRM_Contact_BAO_ContactType::subTypes('Organization'); foreach ($result as $subtype) { - $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE); $subTypeName = in_array($subtype, $this->subTypesOrganization); if (!empty($subTypeName)) { - $this->assertEquals($subTypeName, TRUE, 'In line ' . __LINE__); + $this->assertEquals($subTypeName, TRUE); } $subTypeName = in_array($subTypeName, $this->subTypesHousehold); if (empty($subTypeName)) { - $this->assertEquals($subTypeName, FALSE, 'In line ' . __LINE__); + $this->assertEquals($subTypeName, FALSE); } } // check for type:Household $result = CRM_Contact_BAO_ContactType::subTypes('Household'); foreach ($result as $subtype) { - $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE, 'In line ' . __LINE__); - $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE, 'In line ' . __LINE__); - $this->assertEquals(in_array($subtype, $this->subTypesHousehold), TRUE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE); + $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE); + $this->assertEquals(in_array($subtype, $this->subTypesHousehold), TRUE); } // check for all conatct types $result = CRM_Contact_BAO_ContactType::subTypes(); foreach ($this->subTypesIndividual as $subtype) { - $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $result), TRUE); } foreach ($this->subTypesOrganization as $subtype) { - $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $result), TRUE); } foreach ($this->subTypesHousehold as $subtype) { - $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(in_array($subtype, $result), TRUE); } } @@ -119,11 +119,11 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { $params = 'invalid'; $result = CRM_Contact_BAO_ContactType::subTypes($params); - $this->assertEquals(empty($result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result), TRUE); $params = array('invalid'); $result = CRM_Contact_BAO_ContactType::subTypes($params); - $this->assertEquals(empty($result), TRUE, 'In line ' . __LINE__); + $this->assertEquals(empty($result), TRUE); } /** @@ -173,7 +173,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { 'is_active' => 1, ); $result = CRM_Contact_BAO_ContactType::add($params); - $this->assertEquals($result, NULL, 'In line ' . __LINE__); + $this->assertEquals($result, NULL); } public function testAddInvalid2() { @@ -184,7 +184,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { 'is_active' => 1, ); $result = CRM_Contact_BAO_ContactType::add($params); - $this->assertEquals($result, NULL, 'In line ' . __LINE__); + $this->assertEquals($result, NULL); } public function testAddInvalid3() { @@ -215,8 +215,8 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { $del = CRM_Contact_BAO_ContactType::del($subtype->id); $result = CRM_Contact_BAO_ContactType::subTypes(); - $this->assertEquals($del, TRUE, 'In line ' . __LINE__); - $this->assertEquals(in_array($subtype->name, $result), TRUE, 'In line ' . __LINE__); + $this->assertEquals($del, TRUE); + $this->assertEquals(in_array($subtype->name, $result), TRUE); } /** @@ -225,7 +225,7 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { public function testDelInvalid() { $del = CRM_Contact_BAO_ContactType::del(NULL); - $this->assertEquals($del, FALSE, 'In line ' . __LINE__); + $this->assertEquals($del, FALSE); } } diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php index 68d004a7a2..c44c91fc98 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/RelationshipTest.php @@ -171,8 +171,8 @@ DELETE FROM civicrm_contact_type list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($invalid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__); + $this->assertEquals($invalid, 1); + $this->assertEquals(empty($relationshipIds), TRUE); $this->relationshipTypeDelete($relType->id); } @@ -198,8 +198,8 @@ DELETE FROM civicrm_contact_type list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($invalid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__); + $this->assertEquals($invalid, 1); + $this->assertEquals(empty($relationshipIds), TRUE); $this->relationshipTypeDelete($relType->id); } @@ -223,8 +223,8 @@ DELETE FROM civicrm_contact_type list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($invalid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__); + $this->assertEquals($invalid, 1); + $this->assertEquals(empty($relationshipIds), TRUE); $this->relationshipTypeDelete($relType->id); } @@ -251,8 +251,8 @@ DELETE FROM civicrm_contact_type $ids = array('contact' => $this->individual); list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($valid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__); + $this->assertEquals($valid, 1); + $this->assertEquals(empty($relationshipIds), FALSE); $this->relationshipTypeDelete($relType->id); } @@ -279,8 +279,8 @@ DELETE FROM civicrm_contact_type $ids = array('contact' => $this->organization_sponsor); list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($valid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__); + $this->assertEquals($valid, 1); + $this->assertEquals(empty($relationshipIds), FALSE); $this->relationshipTypeDelete($relType->id); } @@ -304,8 +304,8 @@ DELETE FROM civicrm_contact_type $ids = array('contact' => $this->indivi_student); list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids); - $this->assertEquals($valid, 1, 'In line ' . __LINE__); - $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__); + $this->assertEquals($valid, 1); + $this->assertEquals(empty($relationshipIds), FALSE); $this->relationshipTypeDelete($relType->id); } diff --git a/tests/phpunit/CRM/Contact/BAO/QueryTest.php b/tests/phpunit/CRM/Contact/BAO/QueryTest.php index f9ff18a887..53303312e7 100644 --- a/tests/phpunit/CRM/Contact/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Contact/BAO/QueryTest.php @@ -62,7 +62,7 @@ class CRM_Contact_BAO_QueryTest extends CiviUnitTestCase { sort($contacts, SORT_NUMERIC); - $this->assertEquals($ids, $contacts, 'In line ' . __LINE__); + $this->assertEquals($ids, $contacts); } /** diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index 5a41e8b9a9..c4855c7060 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -149,7 +149,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { ); } asort($all); - $this->assertEquals($full, $all, 'In line ' . __LINE__); + $this->assertEquals($full, $all); } /** @@ -182,7 +182,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { } $contacts = array_keys($contacts); sort($contacts, SORT_NUMERIC); - $this->assertEquals($ids, $contacts, 'In line ' . __LINE__); + $this->assertEquals($ids, $contacts); } /** diff --git a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php index 6cb52548e5..5d9514464a 100644 --- a/tests/phpunit/CRM/Event/BAO/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/BAO/ParticipantTest.php @@ -140,7 +140,7 @@ class CRM_Event_BAO_ParticipantTest extends CiviUnitTestCase { $params = $values = $ids = array(); $participantId = Participant::create($this->_contactId, $this->_eventId); $fetchParticipant = CRM_Event_BAO_Participant::getValues($params, $values, $ids); - $this->assertNull($fetchParticipant, 'In line ' . __LINE__); + $this->assertNull($fetchParticipant); Contact::delete($this->_contactId); Event::delete($this->_eventId); diff --git a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php index fa3e49d128..64079157d6 100644 --- a/tests/phpunit/CRM/Mailing/BAO/QueryTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/QueryTest.php @@ -67,7 +67,7 @@ class CRM_Mailing_BAO_QueryTest extends CiviUnitTestCase { sort($contacts, SORT_NUMERIC); - $this->assertEquals($ids, $contacts, 'In line ' . __LINE__); + $this->assertEquals($ids, $contacts); } } diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index f38e4e80cd..5632513b14 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -307,7 +307,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { $rc = $obj->formRule($params, $files, $obj); // Should have found New membership status - $this->assertTrue($rc, 'In line ' . __LINE__); + $this->assertTrue($rc); } /** @@ -369,7 +369,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { $rc = $obj->formRule($params, $files, $obj); // Should have found Grace membership status - $this->assertTrue($rc, 'In line ' . __LINE__); + $this->assertTrue($rc); } /** @@ -390,7 +390,7 @@ class CRM_Member_Form_MembershipTest extends CiviUnitTestCase { $rc = $obj->formRule($params, $files, $obj); // Should have found Expired membership status - $this->assertTrue($rc, 'In line ' . __LINE__); + $this->assertTrue($rc); } /** diff --git a/tests/phpunit/api/v3/AddressTest.php b/tests/phpunit/api/v3/AddressTest.php index 6fcf3ade87..957a80888b 100644 --- a/tests/phpunit/api/v3/AddressTest.php +++ b/tests/phpunit/api/v3/AddressTest.php @@ -326,7 +326,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { $params = $this->_params; unset($params['is_primary']); $address1 = $this->callAPISuccess('address', 'create', $params); - $this->assertApiSuccess($address1, 'In line ' . __LINE__); + $this->assertApiSuccess($address1); //now we check & make sure it has been set to primary $check = $this->callAPISuccess('address', 'getcount', array( 'is_primary' => 1, diff --git a/tests/phpunit/api/v3/CaseTypeTest.php b/tests/phpunit/api/v3/CaseTypeTest.php index dbfc464315..6d7da7c0cc 100644 --- a/tests/phpunit/api/v3/CaseTypeTest.php +++ b/tests/phpunit/api/v3/CaseTypeTest.php @@ -114,7 +114,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { // Check result. $result = $this->callAPISuccess('CaseType', 'get', array('id' => $id)); - $this->assertEquals($result['values'][$id]['id'], $id, 'in line ' . __LINE__); + $this->assertEquals($result['values'][$id]['id'], $id); $this->assertEquals($result['values'][$id]['title'], $params['title']); } @@ -194,7 +194,7 @@ class api_v3_CaseTypeTest extends CiviCaseTestCase { // Check result $result = $this->callAPISuccess('CaseType', 'get', array('id' => $id)); - $this->assertEquals($result['values'][$id]['id'], $id, 'in line ' . __LINE__); + $this->assertEquals($result['values'][$id]['id'], $id); $this->assertEquals($result['values'][$id]['title'], $params['title']); $this->assertEquals($result['values'][$id]['definition'], $params['definition']); diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index f161d6535b..5975b27a17 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -386,7 +386,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__); $customFldId = $result['values'][$result['id']]['api.CustomField.create']['id']; $this->assertNotNull($result['id']); - $this->assertNotNull($customFldId, 'in line ' . __LINE__); + $this->assertNotNull($customFldId); $params = array( 'id' => $result['id'], @@ -397,7 +397,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__); $this->assertNotNull($result['id']); $customFldDate = date("YmdHis", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest'])); - $this->assertNotNull($customFldDate, 'in line ' . __LINE__); + $this->assertNotNull($customFldDate); $this->assertEquals($dateTime, $customFldDate); $customValueId = $result['values'][$result['id']]['api.CustomValue.get']['values'][0]['id']; $dateTime = date('Ymd'); @@ -421,7 +421,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertNotNull($result['id']); $customFldDate = date("Ymd", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest'])); $customFldTime = date("His", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest'])); - $this->assertNotNull($customFldDate, 'in line ' . __LINE__); + $this->assertNotNull($customFldDate); $this->assertEquals($dateTime, $customFldDate); $this->assertEquals(000000, $customFldTime); $result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__); diff --git a/tests/phpunit/api/v3/ContributionSoftTest.php b/tests/phpunit/api/v3/ContributionSoftTest.php index 4f1fac66f6..3b5809a23b 100644 --- a/tests/phpunit/api/v3/ContributionSoftTest.php +++ b/tests/phpunit/api/v3/ContributionSoftTest.php @@ -103,11 +103,11 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ); $softcontribution = $this->callAPIAndDocument('contribution_soft', 'get', $params, __FUNCTION__, __FILE__); $this->assertEquals(1, $softcontribution['count']); - $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contribution_id'], $this->_contributionId); + $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contact_id'], $this->_softIndividual1Id); $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['amount'], '10.00'); $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['currency'], 'USD'); - $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['soft_credit_type_id'], 4, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['soft_credit_type_id'], 4); //create a second soft contribution on the same hard contribution - we are testing that 'id' gets the right soft contribution id (not the contribution id) $p['contact_id'] = $this->_softIndividual2Id; @@ -209,11 +209,11 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ); $softcontribution = $this->callAPIAndDocument('contribution_soft', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contribution_id'], $this->_contributionId); + $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contact_id'], $this->_softIndividual1Id); $this->assertEquals($softcontribution['values'][$softcontribution['id']]['amount'], '10.00'); $this->assertEquals($softcontribution['values'][$softcontribution['id']]['currency'], 'USD'); - $this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5); } /** @@ -238,7 +238,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ); $original = $this->callAPISuccess('contribution_soft', 'get', $old_params); //Make sure it came back - $this->assertEquals($original['id'], $softcontributionID, 'In line ' . __LINE__); + $this->assertEquals($original['id'], $softcontributionID); //set up list of old params, verify $old_contribution_id = $original['values'][$softcontributionID]['contribution_id']; $old_contact_id = $original['values'][$softcontributionID]['contact_id']; @@ -247,11 +247,11 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $old_soft_credit_type_id = $original['values'][$softcontributionID]['soft_credit_type_id']; //check against original values - $this->assertEquals($old_contribution_id, $this->_contributionId, 'In line ' . __LINE__); - $this->assertEquals($old_contact_id, $this->_softIndividual1Id, 'In line ' . __LINE__); - $this->assertEquals($old_amount, 10.00, 'In line ' . __LINE__); + $this->assertEquals($old_contribution_id, $this->_contributionId); + $this->assertEquals($old_contact_id, $this->_softIndividual1Id); + $this->assertEquals($old_amount, 10.00); $this->assertEquals($old_currency, 'USD'); - $this->assertEquals($old_soft_credit_type_id, 6, 'In line ' . __LINE__); + $this->assertEquals($old_soft_credit_type_id, 6); $params = array( 'id' => $softcontributionID, 'contribution_id' => $this->_contributionId, @@ -268,11 +268,11 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { ); $softcontribution = $this->callAPISuccess('contribution_soft', 'get', $new_params); //check against original values - $this->assertEquals($softcontribution['values'][$softcontributionID]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$softcontributionID]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$softcontributionID]['amount'], 7.00, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$softcontributionID]['contribution_id'], $this->_contributionId); + $this->assertEquals($softcontribution['values'][$softcontributionID]['contact_id'], $this->_softIndividual1Id); + $this->assertEquals($softcontribution['values'][$softcontributionID]['amount'], 7.00); $this->assertEquals($softcontribution['values'][$softcontributionID]['currency'], 'CAD'); - $this->assertEquals($softcontribution['values'][$softcontributionID]['soft_credit_type_id'], 7, 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$softcontributionID]['soft_credit_type_id'], 7); $params = array( 'id' => $softcontributionID, diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index aae9311bea..c38a06262d 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -414,7 +414,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('custom_field', 'delete', $params, __FUNCTION__, __FILE__); - $this->assertAPISuccess($result, 'in line ' . __LINE__); + $this->assertAPISuccess($result); } /** diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index 4816f1157d..4a0d877730 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -95,7 +95,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { $customGroup = $this->callAPIFailure('custom_group', 'create', $params); $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends'); - $this->assertAPIFailure($customGroup, 'In line ' . __LINE__); + $this->assertAPIFailure($customGroup); } /** @@ -355,7 +355,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { 'id' => $customGroup['id'], ); $result = $this->callAPIAndDocument('custom_group', 'delete', $params, __FUNCTION__, __FILE__); - $this->assertAPISuccess($result, 'In line ' . __LINE__); + $this->assertAPISuccess($result); } /** diff --git a/tests/phpunit/api/v3/EmailTest.php b/tests/phpunit/api/v3/EmailTest.php index 735be1bb43..6bc7c12a4a 100644 --- a/tests/phpunit/api/v3/EmailTest.php +++ b/tests/phpunit/api/v3/EmailTest.php @@ -237,7 +237,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { 'contact_id' => $this->_contactID, )); - $this->assertAPISuccess($get, 'In line ' . __LINE__); + $this->assertAPISuccess($get); $this->assertEquals(0, $get['count'], 'Incorrect email count at ' . __LINE__); } @@ -247,7 +247,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { 'contact_id' => $this->_contactID, )); - $this->assertAPISuccess($get, 'In line ' . __LINE__); + $this->assertAPISuccess($get); $this->assertEquals(0, $get['count'], 'email already exists ' . __LINE__); $description = "Demonstrates use of Replace in a nested API call."; $subfile = "NestedReplaceEmail"; diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index a071468e43..b672d56c34 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -363,7 +363,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $this->_params[0]['event_title'] = $this->_params[0]['title']; unset($this->_params[0]['title']); $result = $this->callAPISuccess('Event', 'Create', $this->_params[0]); - $this->assertAPISuccess($result, 'In line ' . __LINE__); + $this->assertAPISuccess($result); $this->assertArrayHasKey('id', $result['values'][$result['id']]); $result = $this->callAPISuccess($this->_entity, 'Get', array('id' => $result['id'])); $this->callAPISuccess($this->_entity, 'Delete', array('id' => $result['id'])); @@ -409,7 +409,7 @@ class api_v3_EventTest extends CiviUnitTestCase { 'event_id' => $this->_eventIds[0], ); $result = $this->callAPISuccess('Event', 'Delete', $params); - $this->assertAPISuccess($result, 'in line ' . __LINE__); + $this->assertAPISuccess($result); } /** diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index f5e826f1a3..e836e188a2 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -133,14 +133,14 @@ class api_v3_GrantTest extends CiviUnitTestCase { $result = $this->callAPISuccess($this->_entity, 'create', $this->params); $this->ids['grant'][0] = $result['id']; $result = $this->callAPIAndDocument($this->_entity, 'get', array('rationale' => 'Just Because'), __FUNCTION__, __FILE__); - $this->assertAPISuccess($result, 'In line ' . __LINE__); + $this->assertAPISuccess($result); $this->assertEquals(1, $result['count']); } public function testDeleteGrant() { $result = $this->callAPISuccess($this->_entity, 'create', $this->params); $result = $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__); - $this->assertAPISuccess($result, 'In line ' . __LINE__); + $this->assertAPISuccess($result); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); $this->assertEquals(0, $checkDeleted['count']); } diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 12cae832f9..ce60eef317 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -66,8 +66,8 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { ); $membershiptype = $this->callAPIAndDocument('membership_type', 'get', $params, __FUNCTION__, __FILE__); $this->assertEquals($membershiptype['values'][$id]['name'], 'General'); - $this->assertEquals($membershiptype['values'][$id]['member_of_contact_id'], $this->_contactID, 'In line ' . __LINE__); - $this->assertEquals($membershiptype['values'][$id]['financial_type_id'], 1, 'In line ' . __LINE__); + $this->assertEquals($membershiptype['values'][$id]['member_of_contact_id'], $this->_contactID); + $this->assertEquals($membershiptype['values'][$id]['financial_type_id'], 1); $this->assertEquals($membershiptype['values'][$id]['duration_unit'], 'year'); $this->assertEquals($membershiptype['values'][$id]['duration_interval'], '1'); $this->assertEquals($membershiptype['values'][$id]['period_type'], 'rolling'); diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 361c927535..8a1fc0301a 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -155,10 +155,10 @@ class api_v3_NoteTest extends CiviUnitTestCase { 'sequential' => 1, ); $result = $this->callAPISuccess('Note', 'Create', $params); - $this->assertAPISuccess($result, 'in line ' . __LINE__); + $this->assertAPISuccess($result); $this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note"); $this->assertEquals($result['values'][0]['subject'], "With a '"); - $this->assertArrayHasKey('id', $result, 'in line ' . __LINE__); + $this->assertArrayHasKey('id', $result); //CleanUP $note = array( @@ -219,8 +219,8 @@ class api_v3_NoteTest extends CiviUnitTestCase { // Update Note. $this->callAPISuccess('note', 'create', $params); $note = $this->callAPISuccess('Note', 'Get', array()); - $this->assertEquals($note['id'], $this->_noteID, 'in line ' . __LINE__); - $this->assertEquals($note['values'][$this->_noteID]['entity_id'], $this->_contactID, 'in line ' . __LINE__); + $this->assertEquals($note['id'], $this->_noteID); + $this->assertEquals($note['values'][$this->_noteID]['entity_id'], $this->_contactID); $this->assertEquals($note['values'][$this->_noteID]['entity_table'], 'civicrm_contact'); $this->assertEquals('Hello World', $note['values'][$this->_noteID]['subject']); $this->assertEquals('Note1', $note['values'][$this->_noteID]['note']); diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index a0fb7722d3..8f7c726288 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -341,7 +341,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { ); $participant = $this->callAPISuccess('participant', 'get', $params); - $this->assertEquals($participant['count'], 2, 'in line ' . __LINE__); + $this->assertEquals($participant['count'], 2); } ///////////////// civicrm_participant_create methods diff --git a/tests/phpunit/api/v3/PriceFieldTest.php b/tests/phpunit/api/v3/PriceFieldTest.php index 001155abdf..96790320da 100644 --- a/tests/phpunit/api/v3/PriceFieldTest.php +++ b/tests/phpunit/api/v3/PriceFieldTest.php @@ -106,9 +106,9 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { $createResult = $this->callAPISuccess($this->_entity, 'create', $this->_params); $deleteParams = array('id' => $createResult['id']); $deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__); - $this->assertAPISuccess($deleteResult, 'In line ' . __LINE__); + $this->assertAPISuccess($deleteResult); $endCount = $this->callAPISuccess($this->_entity, 'getcount', array()); - $this->assertEquals($startCount, $endCount, 'In line ' . __LINE__); + $this->assertEquals($startCount, $endCount); } public function testGetFieldsPriceField() { diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index 0bae4231a6..0a1e16f0e6 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -137,7 +137,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { public function testCreatePriceFieldValue() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertAPISuccess($result, 'In line ' . __LINE__); + $this->assertAPISuccess($result); $this->assertEquals(1, $result['count']); $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->_params, $result['id'], $this->_entity); @@ -162,7 +162,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { $deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__); $endCount = $this->callAPISuccess($this->_entity, 'getcount', array()); - $this->assertEquals($startCount, $endCount, 'In line ' . __LINE__); + $this->assertEquals($startCount, $endCount); } public function testGetFieldsPriceFieldValue() { diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 92567661eb..077c713c78 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -255,14 +255,14 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); $this->_ids['contributionId'] = $contribution['id']; - $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); + $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID); + $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345); + $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF'); - $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20); + $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1); $this->_checkFinancialRecords($contribution, 'online'); } @@ -324,14 +324,14 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { 'contribution_status_id' => 2, ); $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); + $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID); + $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345); + $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF'); - $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20); + $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2); $this->_checkFinancialRecords($contribution, 'payLater'); } @@ -350,14 +350,14 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { ); $contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId); + $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00); + $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID); + $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345); + $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890); $this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF'); - $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__); - $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2, 'In line ' . __LINE__); + $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20); + $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2); $this->_checkFinancialRecords($contribution, 'pending'); } diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index d4a446f1cb..3ad1ddf706 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -95,7 +95,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { $result = $this->callAPISuccess('uf_join', 'get', $searchParams); foreach ($result['values'] as $key => $value) { - $this->assertEquals($value['uf_group_id'], $this->_ufGroupId, 'In line ' . __LINE__); + $this->assertEquals($value['uf_group_id'], $this->_ufGroupId); } } -- 2.25.1