From ba4a1892f2ddcaa33f02ad31bddb62e94675422f Mon Sep 17 00:00:00 2001 From: Tim Mallezie Date: Wed, 20 May 2015 16:43:48 +0200 Subject: [PATCH] remove inline message from assert messages --- .../phpunit/CRM/Activity/BAO/ActivityTest.php | 8 +-- .../BAO/ContactType/ContactSearchTest.php | 54 +++++++++---------- .../Contact/BAO/ContactType/ContactTest.php | 32 +++++------ .../BAO/ContactType/ContactTypeTest.php | 16 +++--- .../Contact/Form/Search/Custom/GroupTest.php | 18 +++---- .../phpunit/CRM/Core/Payment/BaseIPNTest.php | 12 ++--- tests/phpunit/CiviTest/CiviReportTestCase.php | 2 +- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 4 +- .../WebTest/Activity/StandaloneAddTest.php | 2 +- .../WebTest/Contact/UpdateProfileTest.php | 12 ++--- .../phpunit/WebTest/Contribute/PCPAddTest.php | 2 +- .../WebTest/Event/AddParticipationTest.php | 2 +- .../phpunit/WebTest/Event/AddPricesetTest.php | 2 +- tests/phpunit/WebTest/Event/PCPAddTest.php | 4 +- tests/phpunit/api/v3/ActivityTest.php | 24 ++++----- tests/phpunit/api/v3/ActivityTypeTest.php | 4 +- tests/phpunit/api/v3/AddressTest.php | 26 ++++----- tests/phpunit/api/v3/BatchTest.php | 6 +-- tests/phpunit/api/v3/CampaignTest.php | 10 ++-- tests/phpunit/api/v3/CaseTypeTest.php | 6 +-- tests/phpunit/api/v3/ContactTest.php | 16 +++--- tests/phpunit/api/v3/ContributionSoftTest.php | 32 +++++------ tests/phpunit/api/v3/CustomFieldTest.php | 4 +- tests/phpunit/api/v3/CustomGroupTest.php | 36 ++++++------- tests/phpunit/api/v3/CustomSearchTest.php | 10 ++-- .../api/v3/CustomValueContactTypeTest.php | 12 ++--- tests/phpunit/api/v3/CustomValueTest.php | 2 +- tests/phpunit/api/v3/DomainTest.php | 4 +- tests/phpunit/api/v3/EmailTest.php | 34 ++++++------ tests/phpunit/api/v3/EventTest.php | 14 ++--- tests/phpunit/api/v3/GrantTest.php | 8 +-- tests/phpunit/api/v3/ImTest.php | 12 ++--- tests/phpunit/api/v3/JobTest.php | 2 +- tests/phpunit/api/v3/LineItemTest.php | 8 +-- tests/phpunit/api/v3/MembershipTypeTest.php | 8 +-- tests/phpunit/api/v3/MessageTemplateTest.php | 6 +-- tests/phpunit/api/v3/NoteTest.php | 14 ++--- tests/phpunit/api/v3/OptionGroupTest.php | 18 +++---- tests/phpunit/api/v3/OptionValueTest.php | 16 +++--- .../phpunit/api/v3/ParticipantPaymentTest.php | 4 +- .../api/v3/ParticipantStatusTypeTest.php | 12 ++--- tests/phpunit/api/v3/ParticipantTest.php | 2 +- tests/phpunit/api/v3/PaymentProcessorTest.php | 2 +- .../api/v3/PaymentProcessorTypeTest.php | 2 +- tests/phpunit/api/v3/PhoneTest.php | 14 ++--- tests/phpunit/api/v3/PledgeTest.php | 2 +- tests/phpunit/api/v3/PriceFieldTest.php | 6 +-- tests/phpunit/api/v3/PriceFieldValueTest.php | 10 ++-- tests/phpunit/api/v3/RelationshipTypeTest.php | 2 +- tests/phpunit/api/v3/ReportTemplateTest.php | 14 ++--- tests/phpunit/api/v3/SurveyTest.php | 8 +-- .../phpunit/api/v3/SyntaxConformanceTest.php | 14 ++--- tests/phpunit/api/v3/TagTest.php | 10 ++-- .../api/v3/TaxContributionPageTest.php | 6 +-- tests/phpunit/api/v3/UFGroupTest.php | 12 ++--- tests/phpunit/api/v3/UFJoinTest.php | 30 +++++------ tests/phpunit/api/v3/UtilsTest.php | 8 +-- tests/phpunit/api/v3/WebsiteTest.php | 12 ++--- 58 files changed, 336 insertions(+), 336 deletions(-) diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index d35e70c666..8e90f5a3af 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -414,7 +414,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, count($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities)); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -450,7 +450,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, count($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities)); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -493,7 +493,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, count($activities), 'In line ' . __LINE__); + $this->assertEquals($count, count($activities)); foreach ($activities as $key => $value) { $this->assertEquals($value['subject'], "subject {$key}", 'Verify activity subject is correct.'); @@ -546,7 +546,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 activities - $this->assertEquals(0, count($activities), 'In line ' . __LINE__); + $this->assertEquals(0, count($activities)); } } diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php index 1502489f64..492d62dbab 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactSearchTest.php @@ -102,21 +102,21 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Individual $this->assertEquals($individual['contact_id'], $this->individual, 'In line ' . __LINE__); - $this->assertEquals($individual['first_name'], $this->indiviParams['first_name'], 'In line ' . __LINE__); - $this->assertEquals($individual['contact_type'], $this->indiviParams['contact_type'], 'In line ' . __LINE__); + $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['first_name'], $this->indiviStudentParams['first_name'], 'In line ' . __LINE__); - $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type'], 'In line ' . __LINE__); + $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['first_name'], $this->indiviParentParams['first_name'], 'In line ' . __LINE__); - $this->assertEquals($indiviParent['contact_type'], $this->indiviParentParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($indiviParent['contact_sub_type']), $this->indiviParentParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); // for type:Organization $params = array('contact_type' => 'Organization', 'version' => 3); @@ -127,15 +127,15 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Organization $this->assertEquals($organization['contact_id'], $this->organization, 'In line ' . __LINE__); - $this->assertEquals($organization['organization_name'], $this->organizationParams['organization_name'], 'In line ' . __LINE__); - $this->assertEquals($organization['contact_type'], $this->organizationParams['contact_type'], 'In line ' . __LINE__); + $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['organization_name'], $this->orgSponsorParams['organization_name'], 'In line ' . __LINE__); - $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); // for type:Household $params = array('contact_type' => 'Household', 'version' => 3); @@ -145,8 +145,8 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Household $this->assertEquals($household['contact_id'], $this->household, 'In line ' . __LINE__); - $this->assertEquals($household['household_name'], $this->householdParams['household_name'], 'In line ' . __LINE__); - $this->assertEquals($household['contact_type'], $this->householdParams['contact_type'], 'In line ' . __LINE__); + $this->assertEquals($household['household_name'], $this->householdParams['household_name']); + $this->assertEquals($household['contact_type'], $this->householdParams['contact_type']); $this->assertNotContains('contact_sub_type', $household); } @@ -165,9 +165,9 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Individual subtype:Student $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__); - $this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name'], 'In line ' . __LINE__); - $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); //all other contact(rather than subtype:student) should not //exists @@ -185,9 +185,9 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Organization subtype:Sponsor $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__); - $this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name'], 'In line ' . __LINE__); - $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); //all other contact(rather than subtype:Sponsor) should not //exists @@ -213,9 +213,9 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Individual subtype:Student $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__); - $this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name'], 'In line ' . __LINE__); - $this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); //all other contact(rather than subtype:student) should not //exists @@ -233,9 +233,9 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase { //asserts for type:Organization subtype:Sponsor $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__); - $this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name'], 'In line ' . __LINE__); - $this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type'], 'In line ' . __LINE__); - $this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type'], 'In line ' . __LINE__); + $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']); //all other contact(rather than subtype:Sponsor) should not //exists diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php index f50cbf4e22..efc64f23e0 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTest.php @@ -75,8 +75,8 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($contact->first_name, 'Anne', 'In line ' . __LINE__); - $this->assertEquals($contact->contact_type, 'Individual', 'In line ' . __LINE__); + $this->assertEquals($contact->first_name, 'Anne'); + $this->assertEquals($contact->contact_type, 'Individual'); CRM_Contact_BAO_Contact::deleteContact($contact->id); //check for Type:Organization @@ -89,8 +89,8 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($contact->organization_name, 'Compumentor', 'In line ' . __LINE__); - $this->assertEquals($contact->contact_type, 'Organization', 'In line ' . __LINE__); + $this->assertEquals($contact->organization_name, 'Compumentor'); + $this->assertEquals($contact->contact_type, 'Organization'); CRM_Contact_BAO_Contact::deleteContact($contact->id); //check for Type:Household @@ -103,8 +103,8 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($contact->household_name, 'John Does home', 'In line ' . __LINE__); - $this->assertEquals($contact->contact_type, 'Household', 'In line ' . __LINE__); + $this->assertEquals($contact->household_name, 'John Does home'); + $this->assertEquals($contact->contact_type, 'Household'); CRM_Contact_BAO_Contact::deleteContact($contact->id); //check for Type:Individual, Subtype:Student @@ -119,8 +119,8 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($contact->first_name, 'Bill', 'In line ' . __LINE__); - $this->assertEquals($contact->contact_type, 'Individual', 'In line ' . __LINE__); + $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__); CRM_Contact_BAO_Contact::deleteContact($contact->id); @@ -135,8 +135,8 @@ DELETE FROM civicrm_contact_type } catch (Exception$expected) { } - $this->assertEquals($contact->organization_name, 'Conservation Corp', 'In line ' . __LINE__); - $this->assertEquals($contact->contact_type, 'Organization', 'In line ' . __LINE__); + $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__); CRM_Contact_BAO_Contact::deleteContact($contact->id); } @@ -168,7 +168,7 @@ DELETE FROM civicrm_contact_type catch (Exception$expected) { } $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__); + $this->assertEquals($updatedContact->contact_type, 'Individual'); $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student, 'In line ' . __LINE__); CRM_Contact_BAO_Contact::deleteContact($contact->id); @@ -193,7 +193,7 @@ DELETE FROM civicrm_contact_type catch (Exception$expected) { } $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_type, 'Organization', 'In line ' . __LINE__); + $this->assertEquals($updatedContact->contact_type, 'Organization'); $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__); CRM_Contact_BAO_Contact::deleteContact($contact->id); } @@ -226,7 +226,7 @@ DELETE FROM civicrm_contact_type catch (Exception$expected) { } $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__); + $this->assertEquals($updatedContact->contact_type, 'Individual'); $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent, 'In line ' . __LINE__); CRM_Contact_BAO_Contact::deleteContact($contact->id); @@ -253,7 +253,7 @@ DELETE FROM civicrm_contact_type } $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_type, 'Organization', 'In line ' . __LINE__); + $this->assertEquals($updatedContact->contact_type, 'Organization'); $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team, 'In line ' . __LINE__); CRM_Contact_BAO_Contact::deleteContact($contact->id); @@ -281,8 +281,8 @@ DELETE FROM civicrm_contact_type } $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__); - $this->assertEquals($updatedContact->contact_sub_type, 'null', 'In line ' . __LINE__); + $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 05f4c9698d..ed6d0261f4 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php @@ -139,10 +139,10 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { 'is_active' => 1, ); $result = CRM_Contact_BAO_ContactType::add($params); - $this->assertEquals($result->label, $params['label'], 'In line ' . __LINE__); - $this->assertEquals($result->name, $params['name'], 'In line ' . __LINE__); - $this->assertEquals($result->parent_id, $params['parent_id'], 'In line ' . __LINE__); - $this->assertEquals($result->is_active, $params['is_active'], 'In line ' . __LINE__); + $this->assertEquals($result->label, $params['label']); + $this->assertEquals($result->name, $params['name']); + $this->assertEquals($result->parent_id, $params['parent_id']); + $this->assertEquals($result->is_active, $params['is_active']); CRM_Contact_BAO_ContactType::del($result->id); $params = array( @@ -152,10 +152,10 @@ class CRM_Contact_BAO_ContactType_ContactTypeTest extends CiviUnitTestCase { 'is_active' => 0, ); $result = CRM_Contact_BAO_ContactType::add($params); - $this->assertEquals($result->label, $params['label'], 'In line ' . __LINE__); - $this->assertEquals($result->name, $params['name'], 'In line ' . __LINE__); - $this->assertEquals($result->parent_id, $params['parent_id'], 'In line ' . __LINE__); - $this->assertEquals($result->is_active, $params['is_active'], 'In line ' . __LINE__); + $this->assertEquals($result->label, $params['label']); + $this->assertEquals($result->name, $params['name']); + $this->assertEquals($result->parent_id, $params['parent_id']); + $this->assertEquals($result->is_active, $params['is_active']); CRM_Contact_BAO_ContactType::del($result->id); } diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index cde44bd2ed..5a41e8b9a9 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -138,7 +138,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { ); $obj = new CRM_Contact_Form_Search_Custom_Group($fv); $sql = $obj->all(); - $this->assertTrue(is_string($sql), 'In line ' . __LINE__); + $this->assertTrue(is_string($sql)); $dao = CRM_Core_DAO::executeQuery($sql); $all = array(); while ($dao->fetch()) { @@ -174,7 +174,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { ); $obj = new CRM_Contact_Form_Search_Custom_Group($fv); $sql = $obj->contactIDs(); - $this->assertTrue(is_string($sql), 'In line ' . __LINE__); + $this->assertTrue(is_string($sql)); $dao = CRM_Core_DAO::executeQuery($sql); $contacts = array(); while ($dao->fetch()) { @@ -193,10 +193,10 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { $formValues = array(); $obj = new CRM_Contact_Form_Search_Custom_Group($formValues); $columns = $obj->columns(); - $this->assertTrue(is_array($columns), 'In line ' . __LINE__); + $this->assertTrue(is_array($columns)); foreach ($columns as $key => $value) { - $this->assertTrue(is_string($key), 'In line ' . __LINE__); - $this->assertTrue(is_string($value), 'In line ' . __LINE__); + $this->assertTrue(is_string($key)); + $this->assertTrue(is_string($value)); } } @@ -214,7 +214,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { public function testSummary() { $formValues = array(); $obj = new CRM_Contact_Form_Search_Custom_Group($formValues); - $this->assertNull($obj->summary(), 'In line ' . __LINE__); + $this->assertNull($obj->summary()); } /** @@ -225,9 +225,9 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { $formValues = array(); $obj = new CRM_Contact_Form_Search_Custom_Group($formValues); $fileName = $obj->templateFile(); - $this->assertTrue(is_string($fileName), 'In line ' . __LINE__); + $this->assertTrue(is_string($fileName)); //FIXME: we would need to search the include path to do the following - //$this->assertTrue( file_exists( $fileName ), 'In line ' . __LINE__ ); + //$this->assertTrue( file_exists( $fileName ) ); } /** @@ -240,7 +240,7 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { CRM_Core_Form::CB_PREFIX . '23' => TRUE, ); $obj = new CRM_Contact_Form_Search_Custom_Group($formValues); - $this->assertEquals(' (1) ', $obj->where(), 'In line ' . __LINE__); + $this->assertEquals(' (1) ', $obj->where()); } /** diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index 2b6cf80bad..0af779e0a5 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -117,8 +117,8 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $this->_setUpMembershipObjects(); $this->_setUpRecurringContribution(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); - $this->assertFalse(empty($this->objects['membership']), 'in line ' . __LINE__); - $this->assertArrayHasKey($this->_membershipTypeID, $this->objects['membership'], 'in line ' . __LINE__); + $this->assertFalse(empty($this->objects['membership'])); + $this->assertArrayHasKey($this->_membershipTypeID, $this->objects['membership']); $this->assertTrue(is_a($this->objects['membership'][$this->_membershipTypeID], 'CRM_Member_BAO_Membership')); $this->assertTrue(is_a($this->objects['contributionType'], 'CRM_Financial_BAO_FinancialType')); $this->assertFalse(empty($this->objects['contributionRecur']), __LINE__); @@ -136,8 +136,8 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { $contribution->id = $this->_contributionId; $contribution->find(TRUE); $contribution->loadRelatedObjects($this->input, $this->ids, FALSE, TRUE); - $this->assertFalse(empty($contribution->_relatedObjects['membership']), 'in line ' . __LINE__); - $this->assertArrayHasKey($this->_membershipTypeID, $contribution->_relatedObjects['membership'], 'in line ' . __LINE__); + $this->assertFalse(empty($contribution->_relatedObjects['membership'])); + $this->assertArrayHasKey($this->_membershipTypeID, $contribution->_relatedObjects['membership']); $this->assertTrue(is_a($contribution->_relatedObjects['membership'][$this->_membershipTypeID], 'CRM_Member_BAO_Membership')); $this->assertTrue(is_a($contribution->_relatedObjects['contributionType'], 'CRM_Financial_BAO_FinancialType')); $this->assertFalse(empty($contribution->_relatedObjects['contributionRecur']), __LINE__); @@ -177,7 +177,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { public function testLoadParticipantObjects() { $this->_setUpParticipantObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); - $this->assertFalse(empty($this->objects['participant']), 'in line ' . __LINE__); + $this->assertFalse(empty($this->objects['participant'])); $this->assertTrue(is_a($this->objects['participant'], 'CRM_Event_BAO_Participant')); $this->assertTrue(is_a($this->objects['contributionType'], 'CRM_Financial_BAO_FinancialType')); $this->assertFalse(empty($this->objects['event'])); @@ -258,7 +258,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { public function testLoadPledgeObjects() { $this->_setUpPledgeObjects(); $this->IPN->loadObjects($this->input, $this->ids, $this->objects, FALSE, $this->_processorId); - $this->assertFalse(empty($this->objects['pledge_payment'][0]), 'in line ' . __LINE__); + $this->assertFalse(empty($this->objects['pledge_payment'][0])); $this->assertTrue(is_a($this->objects['contributionType'], 'CRM_Financial_BAO_FinancialType')); $this->assertTrue(is_a($this->objects['contribution'], 'CRM_Contribute_BAO_Contribution')); $this->assertTrue(is_a($this->objects['pledge_payment'][0], 'CRM_Pledge_BAO_PledgePayment')); diff --git a/tests/phpunit/CiviTest/CiviReportTestCase.php b/tests/phpunit/CiviTest/CiviReportTestCase.php index f3c7a31b92..5cfe73e3bb 100644 --- a/tests/phpunit/CiviTest/CiviReportTestCase.php +++ b/tests/phpunit/CiviTest/CiviReportTestCase.php @@ -142,7 +142,7 @@ class CiviReportTestCase extends CiviUnitTestCase { 'expected' => $expectedCsvArray[$intKey], 'actual' => $actualCsvArray[$intKey], ), TRUE); - $this->assertNotNull($expectedCsvArray[$intKey], 'In line ' . __LINE__); + $this->assertNotNull($expectedCsvArray[$intKey]); $this->assertEquals( count($actualCsvArray[$intKey]), count($expectedCsvArray[$intKey]), diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 098202c428..7d50b82acd 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -608,11 +608,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { foreach ($expected as $label => $value) { if ($xpathPrefix) { $this->waitForElementPresent("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td"); - $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td", preg_quote($value), 'In line ' . __LINE__); + $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td", preg_quote($value)); } else { $this->waitForElementPresent("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td"); - $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value), 'In line ' . __LINE__); + $this->verifyText("xpath=//table{$tableLocator}/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value)); } } } diff --git a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php index 911336ccf4..7c30e2de98 100644 --- a/tests/phpunit/WebTest/Activity/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Activity/StandaloneAddTest.php @@ -183,7 +183,7 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase { public function VerifyTabularData($expected, $xpathPrefix = NULL) { foreach ($expected as $label => $value) { $this->waitForElementPresent("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span"); - $this->verifyText("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span", preg_quote($value), 'In line ' . __LINE__); + $this->verifyText("xpath=//table/tbody/tr/td{$xpathPrefix}[text()='{$label}']/../following-sibling::td/span", preg_quote($value)); } } diff --git a/tests/phpunit/WebTest/Contact/UpdateProfileTest.php b/tests/phpunit/WebTest/Contact/UpdateProfileTest.php index 809904b619..4406517431 100644 --- a/tests/phpunit/WebTest/Contact/UpdateProfileTest.php +++ b/tests/phpunit/WebTest/Contact/UpdateProfileTest.php @@ -70,12 +70,12 @@ class WebTest_Contact_UpdateProfileTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Confirm save was done. - $this->assertTrue($this->isTextPresent("Thank you. Your information has been saved."), 'In line ' . __LINE__); - $this->assertTrue($this->isTextPresent($firstName), 'In line ' . __LINE__); - $this->assertTrue($this->isTextPresent($lastName), 'In line ' . __LINE__); - $this->assertTrue($this->isTextPresent($street), 'In line ' . __LINE__); - $this->assertTrue($this->isTextPresent($city), 'In line ' . __LINE__); - $this->assertTrue($this->isTextPresent($postalCode), 'In line ' . __LINE__); + $this->assertTrue($this->isTextPresent("Thank you. Your information has been saved.")); + $this->assertTrue($this->isTextPresent($firstName)); + $this->assertTrue($this->isTextPresent($lastName)); + $this->assertTrue($this->isTextPresent($street)); + $this->assertTrue($this->isTextPresent($city)); + $this->assertTrue($this->isTextPresent($postalCode)); $this->assertTrue($this->isElementPresent("//div[@id='profilewrap1']/div[@id='crm-container']/div/div[7]/div[2][contains(text(), 'AR')]")); } diff --git a/tests/phpunit/WebTest/Contribute/PCPAddTest.php b/tests/phpunit/WebTest/Contribute/PCPAddTest.php index 46d1d97023..35cb151861 100755 --- a/tests/phpunit/WebTest/Contribute/PCPAddTest.php +++ b/tests/phpunit/WebTest/Contribute/PCPAddTest.php @@ -193,7 +193,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase { //Check for SoftCredit $softCreditor = "{$firstName} {$lastName}"; - $this->verifyText("xpath=//div['PCPView']/div[2]/table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a", preg_quote($softCreditor), 'In line ' . __LINE__); + $this->verifyText("xpath=//div['PCPView']/div[2]/table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a", preg_quote($softCreditor)); // Check PCP Summary Report $this->openCiviPage('report/instance/16', 'reset=1'); diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 95b88d59bb..b023111b0a 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -313,7 +313,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { 'Check Number' => '1044', ) ); - $this->verifyText("xpath=//table/tbody/tr/td[text()='Total Amount']/following-sibling::td/strong", preg_quote('$ 800.00'), 'In line ' . __LINE__); + $this->verifyText("xpath=//table/tbody/tr/td[text()='Total Amount']/following-sibling::td/strong", preg_quote('$ 800.00')); } public function testEventAddMultipleParticipants() { diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index defe743362..b9befcc29b 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -636,7 +636,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { ) ); $this->waitForElementPresent("xpath=//table/tbody/tr/td[text()='Fees']/following-sibling::td"); - $this->verifyText("xpath=//table/tbody/tr/td[text()='Fees']/following-sibling::td/table/tbody/tr[2]/td", preg_quote('$ 2,705.00'), 'In line ' . __LINE__); + $this->verifyText("xpath=//table/tbody/tr/td[text()='Fees']/following-sibling::td/table/tbody/tr[2]/td", preg_quote('$ 2,705.00')); $expectedLineItems = array( 2 => array( 1 => 'Full Conference', diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index 022f7d78d6..f45144c2bb 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -508,7 +508,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { ) ); $softCreditor = "{$firstNameCreator} {$lastNameCreator}"; - $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor), 'In line ' . __LINE__); + $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor)); } /** @@ -550,7 +550,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { ) ); $softCreditor = "{$pcpCreatorFirstName} {$pcpCreatorLastName}"; - $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor), 'In line ' . __LINE__); + $this->verifyText("xpath=//div[@id='PCPView']/div[2]//table[@class='crm-info-panel']/tbody/tr[2]/td[2]", preg_quote($softCreditor)); } } diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index 0236aed7c8..589a2fd742 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -528,13 +528,13 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('Activity', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals($activity['id'], $result['id'], 'In line ' . __LINE__); + $this->assertEquals($activity['id'], $result['id']); - $this->assertEquals($contact['id'], $result['values'][0]['assignee_contact_id'][0], 'In line ' . __LINE__); + $this->assertEquals($contact['id'], $result['values'][0]['assignee_contact_id'][0]); - $this->assertEquals($this->_contactID, $result['values'][0]['api.contact.get']['values'][0]['contact_id'], 'In line ' . __LINE__); - $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id'], 'In line ' . __LINE__); - $this->assertEquals("test activity type id", $result['values'][0]['subject'], 'In line ' . __LINE__); + $this->assertEquals($this->_contactID, $result['values'][0]['api.contact.get']['values'][0]['contact_id']); + $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id']); + $this->assertEquals("test activity type id", $result['values'][0]['subject']); } /** @@ -597,8 +597,8 @@ class api_v3_ActivityTest extends CiviUnitTestCase { 'target_contact_id' => $contact2, 'return.target_contact_id' => 1, )); - $this->assertEquals($activity['id'], $activityget['id'], 'In line ' . __LINE__); - $this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__); + $this->assertEquals($activity['id'], $activityget['id']); + $this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0]); $activityget = $this->callAPISuccess('activity', 'get', array( 'target_contact_id' => $this->_contactID, @@ -606,7 +606,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { 'id' => $activity['id'], )); if ($activityget['count'] > 0) { - $this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__); + $this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0]); } } @@ -714,7 +714,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals("custom string", $result['values'][0]['custom_' . $ids['custom_field_id']]); $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id']); - $this->assertEquals('test activity type id', $result['values'][0]['subject'], 'In line ' . __LINE__); + $this->assertEquals('test activity type id', $result['values'][0]['subject']); $this->customFieldDelete($ids['custom_field_id']); $this->customGroupDelete($ids['custom_group_id']); } @@ -740,8 +740,8 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('activity', 'get', $params, __FUNCTION__, __FILE__); $this->assertEquals("custom string", $result['values'][0]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__); - $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id'], 'In line ' . __LINE__); - $this->assertEquals('test activity type id', $result['values'][0]['subject'], 'In line ' . __LINE__); + $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id']); + $this->assertEquals('test activity type id', $result['values'][0]['subject']); $this->assertEquals($result['values'][0]['id'], $result['id']); } @@ -1108,7 +1108,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('activity', 'get', $params); - $this->assertEquals(2, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(2, $result['count']); $this->assertEquals($this->test_activity_type_value, $result['values'][$activity['id']]['activity_type_id']); $this->assertEquals('Test activity type', $result['values'][$activity['id']]['activity_name']); $this->assertEquals('Test activity type', $result['values'][$activity2['id']]['activity_name']); diff --git a/tests/phpunit/api/v3/ActivityTypeTest.php b/tests/phpunit/api/v3/ActivityTypeTest.php index 7664ec4466..bf9af844b8 100644 --- a/tests/phpunit/api/v3/ActivityTypeTest.php +++ b/tests/phpunit/api/v3/ActivityTypeTest.php @@ -48,8 +48,8 @@ class api_v3_ActivityTypeTest extends CiviUnitTestCase { public function testActivityTypeGet() { $params = array(); $result = $this->callAPIAndDocument('activity_type', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($result['values']['1'], 'Meeting', 'In line ' . __LINE__); - $this->assertEquals($result['values']['13'], 'Open Case', 'In line ' . __LINE__); + $this->assertEquals($result['values']['1'], 'Meeting'); + $this->assertEquals($result['values']['13'], 'Open Case'); } /** diff --git a/tests/phpunit/api/v3/AddressTest.php b/tests/phpunit/api/v3/AddressTest.php index 9d60bb2146..6fcf3ade87 100644 --- a/tests/phpunit/api/v3/AddressTest.php +++ b/tests/phpunit/api/v3/AddressTest.php @@ -74,8 +74,8 @@ class api_v3_AddressTest extends CiviUnitTestCase { public function testCreateAddress() { $result = $this->callAPIAndDocument('address', 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->_params, $result['id'], 'address'); } @@ -89,10 +89,10 @@ class api_v3_AddressTest extends CiviUnitTestCase { $subfile = "AddressParse"; $description = "Demonstrates Use of address parsing param."; $result = $this->callAPIAndDocument('address', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals(54, $result['values'][$result['id']]['street_number'], 'In line ' . __LINE__); - $this->assertEquals('A', $result['values'][$result['id']]['street_number_suffix'], 'In line ' . __LINE__); - $this->assertEquals('Excelsior Ave.', $result['values'][$result['id']]['street_name'], 'In line ' . __LINE__); - $this->assertEquals('Apt 1C', $result['values'][$result['id']]['street_unit'], 'In line ' . __LINE__); + $this->assertEquals(54, $result['values'][$result['id']]['street_number']); + $this->assertEquals('A', $result['values'][$result['id']]['street_number_suffix']); + $this->assertEquals('Excelsior Ave.', $result['values'][$result['id']]['street_name']); + $this->assertEquals('Apt 1C', $result['values'][$result['id']]['street_unit']); $this->callAPISuccess('address', 'delete', array('id' => $result['id'])); } @@ -104,8 +104,8 @@ class api_v3_AddressTest extends CiviUnitTestCase { $params = $this->_params; unset($params['is_primary']); $result = $this->callAPISuccess('address', 'create', $params); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals(1, $result['values'][$result['id']]['is_primary'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals(1, $result['values'][$result['id']]['is_primary']); $this->getAndCheck($this->_params, $result['id'], 'address'); } @@ -211,7 +211,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { $create = $this->callAPISuccess('address', 'create', $this->_params); $result = $this->callAPIAndDocument('address', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $get = $this->callAPISuccess('address', 'get', array( 'location_type_id' => $this->_locationType->id, )); @@ -244,7 +244,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { 'contact_id' => $this->_contactID, ); $address = $this->callAPISuccess('Address', 'getsingle', ($params)); - $this->assertEquals($address['location_type_id'], $this->_params['location_type_id'], 'In line ' . __LINE__); + $this->assertEquals($address['location_type_id'], $this->_params['location_type_id']); $this->callAPISuccess('address', 'delete', array('id' => $address['id'])); } @@ -281,8 +281,8 @@ class api_v3_AddressTest extends CiviUnitTestCase { 'sequential' => 1, ); $result = $this->callAPIAndDocument('Address', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals('Ambachtstraat 23', $result['values'][0]['street_address'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals('Ambachtstraat 23', $result['values'][0]['street_address']); $this->callAPISuccess('address', 'delete', array('id' => $result['id'])); } @@ -296,7 +296,7 @@ class api_v3_AddressTest extends CiviUnitTestCase { 'sequential' => 1, ); $result = $this->callAPISuccess('Address', 'Get', ($params)); - $this->assertEquals(0, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $result['count']); $this->callAPISuccess('address', 'delete', array('id' => $create['id'])); } diff --git a/tests/phpunit/api/v3/BatchTest.php b/tests/phpunit/api/v3/BatchTest.php index 31ed05b6f4..08d029a512 100644 --- a/tests/phpunit/api/v3/BatchTest.php +++ b/tests/phpunit/api/v3/BatchTest.php @@ -66,7 +66,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { 'id' => $this->batchCreate(), ); $result = $this->callAPIAndDocument('batch', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($params['id'], $result['id'], 'In line ' . __LINE__); + $this->assertEquals($params['id'], $result['id']); } /** @@ -83,7 +83,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('batch', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['id']); $this->getAndCheck($params, $result['id'], $this->_entity); } @@ -101,7 +101,7 @@ class api_v3_BatchTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('batch', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['id']); $this->getAndCheck($params, $result['id'], $this->_entity); } diff --git a/tests/phpunit/api/v3/CampaignTest.php b/tests/phpunit/api/v3/CampaignTest.php index 0b2cac873d..e2bb1269a1 100644 --- a/tests/phpunit/api/v3/CampaignTest.php +++ b/tests/phpunit/api/v3/CampaignTest.php @@ -53,16 +53,16 @@ class api_v3_CampaignTest extends CiviUnitTestCase { $description = "Create a campaign - Note use of relative dates here: @link http://www.php.net/manual/en/datetime.formats.relative.php."; $result = $this->callAPIAndDocument('campaign', 'create', $this->params, __FUNCTION__, __FILE__, $description); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck(array_merge($this->params, array('created_date' => '2008-07-05 00:00:00')), $result['id'], 'campaign', TRUE); } public function testGetCampaign() { $result = $this->callAPISuccess('campaign', 'create', $this->params); $result = $this->callAPIAndDocument('campaign', 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); } public function testDeleteCampaign() { @@ -72,7 +72,7 @@ class api_v3_CampaignTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('campaign', 'delete', $delete, __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess('campaign', 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } } diff --git a/tests/phpunit/api/v3/CaseTypeTest.php b/tests/phpunit/api/v3/CaseTypeTest.php index 48a5af5ca6..dbfc464315 100644 --- a/tests/phpunit/api/v3/CaseTypeTest.php +++ b/tests/phpunit/api/v3/CaseTypeTest.php @@ -115,7 +115,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]['title'], $params['title'], 'in line ' . __LINE__); + $this->assertEquals($result['values'][$id]['title'], $params['title']); } /** @@ -195,8 +195,8 @@ 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]['title'], $params['title'], 'in line ' . __LINE__); - $this->assertEquals($result['values'][$id]['definition'], $params['definition'], 'in line ' . __LINE__); + $this->assertEquals($result['values'][$id]['title'], $params['title']); + $this->assertEquals($result['values'][$id]['definition'], $params['definition']); $caseXml = CRM_Case_XMLRepository::singleton()->retrieve('Application_with_Definition'); $this->assertTrue($caseXml instanceof SimpleXMLElement); diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index be633e4ec9..f161d6535b 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -385,7 +385,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'], 'in line ' . __LINE__); + $this->assertNotNull($result['id']); $this->assertNotNull($customFldId, 'in line ' . __LINE__); $params = array( @@ -395,7 +395,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'in line ' . __LINE__); + $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->assertEquals($dateTime, $customFldDate); @@ -418,7 +418,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { 'api.CustomValue.get' => 1, ); $result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'in line ' . __LINE__); + $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__); @@ -2026,7 +2026,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('address', 'create', $params); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); // now do a proximity search with a close enough geocode and hope to match // that specific contact only! @@ -2037,7 +2037,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { 'distance' => 10, ); $result = $this->callAPISuccess('contact', 'proximity', $proxParams); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); } /** @@ -2185,14 +2185,14 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->individualCreate(array('last_name' => $name, 'is_deleted' => 1)); // We should get all but the deleted contact. $result = $this->callAPISuccess('contact', 'getlist', array('input' => $name)); - $this->assertEquals(2, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(2, $result['count']); // Force-exclude the deceased contact. $result = $this->callAPISuccess('contact', 'getlist', array( 'input' => $name, 'params' => array('is_deceased' => 0), )); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals($contact, $result['values'][0]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals($contact, $result['values'][0]['id']); } /** diff --git a/tests/phpunit/api/v3/ContributionSoftTest.php b/tests/phpunit/api/v3/ContributionSoftTest.php index bbe03ca813..4f1fac66f6 100644 --- a/tests/phpunit/api/v3/ContributionSoftTest.php +++ b/tests/phpunit/api/v3/ContributionSoftTest.php @@ -105,8 +105,8 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $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']]['amount'], '10.00', 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['currency'], 'USD', 'In line ' . __LINE__); + $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__); //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) @@ -121,7 +121,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $result = $this->callAPISuccess('contribution_soft', 'get', array( 'id' => $this->_softcontribution['id'], )); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertEquals($this->_softcontribution['id'], $result['id']); $this->assertEquals($this->_softcontribution['id'], $result['id'], print_r($softcontribution, TRUE)); @@ -137,7 +137,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { 'contact_id' => $this->_softIndividual2Id, ) ); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->callAPISuccess('contribution_soft', 'Delete', array( 'id' => $this->_softcontribution['id'], @@ -211,8 +211,8 @@ 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']]['amount'], '10.00', 'In line ' . __LINE__); - $this->assertEquals($softcontribution['values'][$softcontribution['id']]['currency'], 'USD', 'In line ' . __LINE__); + $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__); } @@ -250,7 +250,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $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_currency, 'USD', 'In line ' . __LINE__); + $this->assertEquals($old_currency, 'USD'); $this->assertEquals($old_soft_credit_type_id, 6, 'In line ' . __LINE__); $params = array( 'id' => $softcontributionID, @@ -271,7 +271,7 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $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]['currency'], 'CAD', 'In line ' . __LINE__); + $this->assertEquals($softcontribution['values'][$softcontributionID]['currency'], 'CAD'); $this->assertEquals($softcontribution['values'][$softcontributionID]['soft_credit_type_id'], 7, 'In line ' . __LINE__); $params = array( @@ -332,10 +332,10 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { // We're taking the first element. $res = $result['values'][$softcontribution['id']]; - $this->assertEquals($p['contribution_id'], $res['contribution_id'], 'In line ' . __LINE__); - $this->assertEquals($p['contact_id'], $res['contact_id'], 'In line ' . __LINE__); - $this->assertEquals($p['amount'], $res['amount'], 'In line ' . __LINE__); - $this->assertEquals($p['currency'], $res['currency'], 'In line ' . __LINE__); + $this->assertEquals($p['contribution_id'], $res['contribution_id']); + $this->assertEquals($p['contact_id'], $res['contact_id']); + $this->assertEquals($p['amount'], $res['amount']); + $this->assertEquals($p['currency'], $res['currency']); } /** @@ -364,10 +364,10 @@ class api_v3_ContributionSoftTest extends CiviUnitTestCase { $result = $this->callAPISuccess('contribution_soft', 'get', $params); $res = $result['values'][$softcontribution2['id']]; - $this->assertEquals($p2['contribution_id'], $res['contribution_id'], 'In line ' . __LINE__); - $this->assertEquals($p2['contact_id'], $res['contact_id'], 'In line ' . __LINE__); - $this->assertEquals($p2['amount'], $res['amount'], 'In line ' . __LINE__); - $this->assertEquals($p2['currency'], $res['currency'], 'In line ' . __LINE__); + $this->assertEquals($p2['contribution_id'], $res['contribution_id']); + $this->assertEquals($p2['contact_id'], $res['contact_id']); + $this->assertEquals($p2['amount'], $res['amount']); + $this->assertEquals($p2['currency'], $res['currency']); } } diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 221908c309..aae9311bea 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -107,7 +107,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { $params['id'] = $customField['id']; $customField = $this->callAPISuccess('custom_field', 'create', $params); - $this->assertNotNull($customField['id'], 'in line ' . __LINE__); + $this->assertNotNull($customField['id']); } /** @@ -407,7 +407,7 @@ class api_v3_CustomFieldTest extends CiviUnitTestCase { public function testCustomFieldDelete() { $customGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group')); $customField = $this->customFieldCreate(array('custom_group_id' => $customGroup['id'])); - $this->assertNotNull($customField['id'], 'in line ' . __LINE__); + $this->assertNotNull($customField['id']); $params = array( 'id' => $customField['id'], diff --git a/tests/phpunit/api/v3/CustomGroupTest.php b/tests/phpunit/api/v3/CustomGroupTest.php index cdcfac787d..4816f1157d 100644 --- a/tests/phpunit/api/v3/CustomGroupTest.php +++ b/tests/phpunit/api/v3/CustomGroupTest.php @@ -94,7 +94,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', 'In line ' . __LINE__); + $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends'); $this->assertAPIFailure($customGroup, 'In line ' . __LINE__); } @@ -116,7 +116,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', 'In line ' . __LINE__); + $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends'); } /** @@ -156,8 +156,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('custom_group', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); - $this->assertEquals($result['values'][$result['id']]['extends'], 'Individual', 'In line ' . __LINE__); + $this->assertNotNull($result['id']); + $this->assertEquals($result['values'][$result['id']]['extends'], 'Individual'); } /** @@ -213,8 +213,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $customGroup = $this->callAPISuccess('custom_group', 'create', $params); - $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Inline', 'In line ' . __LINE__); + $this->assertNotNull($customGroup['id']); + $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Inline'); } /** @@ -223,7 +223,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { public function testCustomGroupCreateNotArray() { $params = NULL; $customGroup = $this->callAPIFailure('custom_group', 'create', $params); - $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); + $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array'); } /** @@ -259,9 +259,9 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $customGroup = $this->callAPISuccess('custom_group', 'create', $params); - $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Household', 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Tab', 'In line ' . __LINE__); + $this->assertNotNull($customGroup['id']); + $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Household'); + $this->assertEquals($customGroup['values'][$customGroup['id']]['style'], 'Tab'); } /** @@ -281,8 +281,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $customGroup = $this->callAPISuccess('custom_group', 'create', $params); - $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Contribution', 'In line ' . __LINE__); + $this->assertNotNull($customGroup['id']); + $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Contribution'); } /** @@ -303,8 +303,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $customGroup = $this->callAPISuccess('custom_group', 'create', $params); - $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Group', 'In line ' . __LINE__); + $this->assertNotNull($customGroup['id']); + $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Group'); } /** @@ -323,8 +323,8 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { ); $customGroup = $this->callAPISuccess('custom_group', 'create', $params); - $this->assertNotNull($customGroup['id'], 'In line ' . __LINE__); - $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Activity', 'In line ' . __LINE__); + $this->assertNotNull($customGroup['id']); + $this->assertEquals($customGroup['values'][$customGroup['id']]['extends'], 'Activity'); } ///////////////// civicrm_custom_group_delete methods @@ -334,7 +334,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { */ public function testCustomGroupDeleteWithoutGroupID() { $customGroup = $this->callAPIFailure('custom_group', 'delete', array()); - $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: id', 'In line ' . __LINE__); + $this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: id'); } /** @@ -343,7 +343,7 @@ class api_v3_CustomGroupTest extends CiviUnitTestCase { public function testCustomGroupDeleteNoArray() { $params = NULL; $customGroup = $this->callAPIFailure('custom_group', 'delete', $params); - $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); + $this->assertEquals($customGroup['error_message'], 'Input variable `params` is not an array'); } /** diff --git a/tests/phpunit/api/v3/CustomSearchTest.php b/tests/phpunit/api/v3/CustomSearchTest.php index b273816637..8a18768f85 100644 --- a/tests/phpunit/api/v3/CustomSearchTest.php +++ b/tests/phpunit/api/v3/CustomSearchTest.php @@ -21,9 +21,9 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase { 'class_name' => 'CRM_Contact_Form_Search_Custom_Examplez', )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $entityId = $result['id']; - $this->assertTrue(is_numeric($entityId), 'In line ' . __LINE__); + $this->assertTrue(is_numeric($entityId)); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Contact_Form_Search_Custom_Examplez" AND label = "CRM_Contact_Form_Search_Custom_Examplez" @@ -37,7 +37,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase { 'is_active' => 0, )); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Contact_Form_Search_Custom_Examplez" AND label = "CRM_Contact_Form_Search_Custom_Examplez" @@ -51,7 +51,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase { 'is_active' => 1, )); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Contact_Form_Search_Custom_Examplez" AND label = "CRM_Contact_Form_Search_Custom_Examplez" @@ -62,7 +62,7 @@ class api_v3_CustomSearchTest extends CiviUnitTestCase { $result = $this->callAPISuccess('CustomSearch', 'delete', array( 'id' => $entityId, )); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Contact_Form_Search_Custom_Examplez" OR label = "CRM_Contact_Form_Search_Custom_Examplez" diff --git a/tests/phpunit/api/v3/CustomValueContactTypeTest.php b/tests/phpunit/api/v3/CustomValueContactTypeTest.php index a82c8cb750..36ebe5ce62 100644 --- a/tests/phpunit/api/v3/CustomValueContactTypeTest.php +++ b/tests/phpunit/api/v3/CustomValueContactTypeTest.php @@ -171,12 +171,12 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { ); $contact = $this->callAPISuccess('contact', 'create', $params); - $this->assertNotNull($contact['id'], 'In line ' . __LINE__); + $this->assertNotNull($contact['id']); $entityValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->individual); $elements["custom_{$this->IndividualField['id']}"] = $entityValues["{$this->IndividualField['id']}"]; // Check the Value in Database - $this->assertEquals($elements["custom_{$this->IndividualField['id']}"], 'Test String', 'In line ' . __LINE__); + $this->assertEquals($elements["custom_{$this->IndividualField['id']}"], 'Test String'); } /** @@ -209,12 +209,12 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $result = $this->callAPISuccess('contact', 'create', $params); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['id']); $entityValues = CRM_Core_BAO_CustomValueTable::getEntityValues($this->individualStudent); $elements["custom_{$this->IndiStudentField['id']}"] = $entityValues["{$this->IndiStudentField['id']}"]; // Check the Value in Database - $this->assertEquals($elements["custom_{$this->IndiStudentField['id']}"], 'Test String', 'in line ' . __LINE__); + $this->assertEquals($elements["custom_{$this->IndiStudentField['id']}"], 'Test String'); } /** @@ -257,7 +257,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $getContact = $this->callAPISuccess('contact', 'get', $params); - $this->assertEquals($getContact['values'][$this->individual]["custom_" . $this->IndividualField['id']], 'Test String', 'In line ' . __LINE__); + $this->assertEquals($getContact['values'][$this->individual]["custom_" . $this->IndividualField['id']], 'Test String'); } /** @@ -283,7 +283,7 @@ class api_v3_CustomValueContactTypeTest extends CiviUnitTestCase { $getContact = $this->callAPISuccess('contact', 'get', $params); - $this->assertEquals($getContact['values'][$this->individualStudent]["custom_{$this->IndiStudentField['id']}"], 'Test String', 'In line ' . __LINE__); + $this->assertEquals($getContact['values'][$this->individualStudent]["custom_{$this->IndiStudentField['id']}"], 'Test String'); } } diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index e4f9ed3167..bd7b73dcff 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -67,7 +67,7 @@ class api_v3_CustomValueTest extends CiviUnitTestCase { ) + $this->params; $result = $this->callAPIAndDocument('custom_value', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $result = $this->callAPISuccess('custom_value', 'get', $params); } diff --git a/tests/phpunit/api/v3/DomainTest.php b/tests/phpunit/api/v3/DomainTest.php index f83f96a3ce..a13be7966b 100644 --- a/tests/phpunit/api/v3/DomainTest.php +++ b/tests/phpunit/api/v3/DomainTest.php @@ -105,7 +105,7 @@ class api_v3_DomainTest extends CiviUnitTestCase { $this->assertType('array', $result); $domain = $result['values'][0]; - $this->assertEquals("info@EXAMPLE.ORG", $domain['from_email'], 'In line ' . __LINE__); + $this->assertEquals("info@EXAMPLE.ORG", $domain['from_email']); $this->assertEquals("FIXME", $domain['from_name']); // checking other important parts of domain information // test will fail if backward incompatible changes happen @@ -127,7 +127,7 @@ class api_v3_DomainTest extends CiviUnitTestCase { continue; } - $this->assertEquals("info@EXAMPLE.ORG", $domain['from_email'], 'In line ' . __LINE__); + $this->assertEquals("info@EXAMPLE.ORG", $domain['from_email']); $this->assertEquals("FIXME", $domain['from_name']); // checking other important parts of domain information diff --git a/tests/phpunit/api/v3/EmailTest.php b/tests/phpunit/api/v3/EmailTest.php index b16c9419f9..735be1bb43 100644 --- a/tests/phpunit/api/v3/EmailTest.php +++ b/tests/phpunit/api/v3/EmailTest.php @@ -70,9 +70,9 @@ class api_v3_EmailTest extends CiviUnitTestCase { $this->assertEquals(0, $get['count'], 'Contact not successfully deleted In line ' . __LINE__); $result = $this->callAPIAndDocument('email', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['id']); + $this->assertNotNull($result['values'][$result['id']]['id']); $delresult = $this->callAPISuccess('email', 'delete', array('id' => $result['id'])); } @@ -107,8 +107,8 @@ class api_v3_EmailTest extends CiviUnitTestCase { public function testCreateEmailWithoutEmail() { $result = $this->callAPIFailure('Email', 'Create', array('contact_id' => 4)); - $this->assertContains('missing', $result['error_message'], 'In line ' . __LINE__); - $this->assertContains('email', $result['error_message'], 'In line ' . __LINE__); + $this->assertContains('missing', $result['error_message']); + $this->assertContains('email', $result['error_message']); } public function testGetEmail() { @@ -141,7 +141,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { $create = $this->callAPISuccess('email', 'create', $params); $result = $this->callAPIAndDocument('email', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $get = $this->callAPISuccess('email', 'get', array( 'location_type_id' => $this->_locationType->id, )); @@ -187,7 +187,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $replace1 = $this->callAPIAndDocument('email', 'replace', $replace1Params, __FUNCTION__, __FILE__); - $this->assertEquals(5, $replace1['count'], 'In line ' . __LINE__); + $this->assertEquals(5, $replace1['count']); // check emails at location #1 or #2 $get = $this->callAPISuccess('email', 'get', array( @@ -207,7 +207,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $replace2 = $this->callAPISuccess('email', 'replace', $replace2Params); - $this->assertEquals(1, $replace2['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $replace2['count']); // check emails at location #1 -- all three replaced by one $get = $this->callAPISuccess('email', 'get', array( @@ -230,7 +230,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { 'values' => array(), ); $replace3 = $this->callAPISuccess('email', 'replace', $replace3Params); - $this->assertEquals(0, $replace3['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $replace3['count']); // check emails $get = $this->callAPISuccess('email', 'get', array( @@ -286,7 +286,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $getReplace1 = $this->callAPIAndDocument('contact', 'get', $getReplace1Params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals(5, $getReplace1['values'][$this->_contactID]['api.email.replace']['count'], 'In line ' . __LINE__); + $this->assertEquals(5, $getReplace1['values'][$this->_contactID]['api.email.replace']['count']); // check emails at location #1 or #2 $get = $this->callAPISuccess('email', 'get', array( @@ -308,8 +308,8 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $getReplace2 = $this->callAPISuccess('contact', 'get', $getReplace2Params); - $this->assertEquals(0, $getReplace2['values'][$this->_contactID]['api.email.replace']['is_error'], 'In line ' . __LINE__); - $this->assertEquals(1, $getReplace2['values'][$this->_contactID]['api.email.replace']['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $getReplace2['values'][$this->_contactID]['api.email.replace']['is_error']); + $this->assertEquals(1, $getReplace2['values'][$this->_contactID]['api.email.replace']['count']); // check emails at location #1 -- all three replaced by one $get = $this->callAPISuccess('email', 'get', array( @@ -347,7 +347,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $replace1 = $this->callAPISuccess('email', 'replace', $replace1Params); - $this->assertEquals(1, $replace1['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $replace1['count']); $keys = array_keys($replace1['values']); $emailID = array_shift($keys); @@ -363,7 +363,7 @@ class api_v3_EmailTest extends CiviUnitTestCase { ), ); $replace2 = $this->callAPISuccess('email', 'replace', $replace2Params); - $this->assertEquals(1, $replace2['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $replace2['count']); // ensure the 'email' was updated while other fields were preserved $get = $this->callAPISuccess('email', 'get', array( @@ -372,9 +372,9 @@ class api_v3_EmailTest extends CiviUnitTestCase { )); $this->assertEquals(1, $get['count'], 'Incorrect email count at ' . __LINE__); - $this->assertEquals(1, $get['values'][$emailID]['is_primary'], 'In line ' . __LINE__); - $this->assertEquals(1, $get['values'][$emailID]['on_hold'], 'In line ' . __LINE__); - $this->assertEquals('1-2@example.com', $get['values'][$emailID]['email'], 'In line ' . __LINE__); + $this->assertEquals(1, $get['values'][$emailID]['is_primary']); + $this->assertEquals(1, $get['values'][$emailID]['on_hold']); + $this->assertEquals('1-2@example.com', $get['values'][$emailID]['email']); } } diff --git a/tests/phpunit/api/v3/EventTest.php b/tests/phpunit/api/v3/EventTest.php index 6407c635e6..a071468e43 100644 --- a/tests/phpunit/api/v3/EventTest.php +++ b/tests/phpunit/api/v3/EventTest.php @@ -345,7 +345,7 @@ class api_v3_EventTest extends CiviUnitTestCase { public function testCreateEventSuccess() { $result = $this->callAPIAndDocument('Event', 'Create', $this->_params[0], __FUNCTION__, __FILE__); - $this->assertArrayHasKey('id', $result['values'][$result['id']], 'In line ' . __LINE__); + $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'])); $this->assertEquals('2008-10-21 00:00:00', $result['values'][$result['id']]['start_date'], 'start date is not set in line ' . __LINE__); @@ -364,7 +364,7 @@ class api_v3_EventTest extends CiviUnitTestCase { unset($this->_params[0]['title']); $result = $this->callAPISuccess('Event', 'Create', $this->_params[0]); $this->assertAPISuccess($result, 'In line ' . __LINE__); - $this->assertArrayHasKey('id', $result['values'][$result['id']], 'In line ' . __LINE__); + $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'])); @@ -472,8 +472,8 @@ class api_v3_EventTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('event', 'get', $params); - $this->assertEquals($result['values'][$this->_eventIds[0]]['id'], $this->_eventIds[0], 'In line ' . __LINE__); - $this->assertEquals($result['values'][$this->_eventIds[0]]['title'], 'Annual CiviCRM meet', 'In line ' . __LINE__); + $this->assertEquals($result['values'][$this->_eventIds[0]]['id'], $this->_eventIds[0]); + $this->assertEquals($result['values'][$this->_eventIds[0]]['title'], 'Annual CiviCRM meet'); } /** @@ -532,7 +532,7 @@ class api_v3_EventTest extends CiviUnitTestCase { $description = "Demonstrate use of getfields to interrogate api."; $params = array('action' => 'create'); $result = $this->callAPISuccess('event', 'getfields', $params); - $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__); + $this->assertEquals(1, $result['values']['title']['api.required']); } /** @@ -542,14 +542,14 @@ class api_v3_EventTest extends CiviUnitTestCase { $description = "Demonstrate use of getfields to interrogate api."; $params = array('api_action' => 'create'); $result = $this->callAPISuccess('event', 'getfields', $params); - $this->assertEquals(1, $result['values']['title']['api.required'], 'in line ' . __LINE__); + $this->assertEquals(1, $result['values']['title']['api.required']); } public function testgetfieldsGet() { $description = "Demonstrate use of getfields to interrogate api."; $params = array('action' => 'get'); $result = $this->callAPISuccess('event', 'getfields', $params); - $this->assertEquals('title', $result['values']['event_title']['name'], 'in line ' . __LINE__); + $this->assertEquals('title', $result['values']['event_title']['name']); } public function testgetfieldsDelete() { diff --git a/tests/phpunit/api/v3/GrantTest.php b/tests/phpunit/api/v3/GrantTest.php index a581bd499f..f5e826f1a3 100644 --- a/tests/phpunit/api/v3/GrantTest.php +++ b/tests/phpunit/api/v3/GrantTest.php @@ -68,8 +68,8 @@ class api_v3_GrantTest extends CiviUnitTestCase { public function testCreateGrant() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->params, $result['id'], $this->_entity); } @@ -134,7 +134,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { $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->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); } public function testDeleteGrant() { @@ -142,7 +142,7 @@ class api_v3_GrantTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__); $this->assertAPISuccess($result, 'In line ' . __LINE__); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } /** diff --git a/tests/phpunit/api/v3/ImTest.php b/tests/phpunit/api/v3/ImTest.php index bef66f912f..f5e61d4ba3 100644 --- a/tests/phpunit/api/v3/ImTest.php +++ b/tests/phpunit/api/v3/ImTest.php @@ -58,16 +58,16 @@ class api_v3_ImTest extends CiviUnitTestCase { public function testCreateIm() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->getAndCheck($this->params, $result['id'], $this->_entity); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['values'][$result['id']]['id']); } public function testGetIm() { $result = $this->callAPISuccess($this->_entity, 'create', $this->params); $result = $this->callAPIAndDocument($this->_entity, 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result['id'])); } @@ -76,7 +76,7 @@ class api_v3_ImTest extends CiviUnitTestCase { $deleteParams = array('id' => $result['id']); $result = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } public function testDeleteImInvalid() { @@ -84,7 +84,7 @@ class api_v3_ImTest extends CiviUnitTestCase { $deleteParams = array('id' => 600); $result = $this->callAPIFailure($this->_entity, 'delete', $deleteParams); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(1, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $checkDeleted['count']); } } diff --git a/tests/phpunit/api/v3/JobTest.php b/tests/phpunit/api/v3/JobTest.php index f5fcc6ffa8..71f8bed6a8 100644 --- a/tests/phpunit/api/v3/JobTest.php +++ b/tests/phpunit/api/v3/JobTest.php @@ -96,7 +96,7 @@ class api_v3_JobTest extends CiviUnitTestCase { */ public function testCreate() { $result = $this->callAPIAndDocument('job', 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['values'][0]['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['values'][0]['id']); // mutate $params to match expected return value unset($this->_params['sequential']); diff --git a/tests/phpunit/api/v3/LineItemTest.php b/tests/phpunit/api/v3/LineItemTest.php index 4dad3fc811..f9a75e1b85 100644 --- a/tests/phpunit/api/v3/LineItemTest.php +++ b/tests/phpunit/api/v3/LineItemTest.php @@ -71,8 +71,8 @@ class api_v3_LineItemTest extends CiviUnitTestCase { public function testCreateLineItem() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->params + array('debug' => 1), __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->params, $result['id'], $this->_entity); } @@ -81,7 +81,7 @@ class api_v3_LineItemTest extends CiviUnitTestCase { 'entity_table' => 'civicrm_contribution', ); $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__); - $this->assertEquals(1, $getResult['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $getResult['count']); } public function testDeleteLineItem() { @@ -92,7 +92,7 @@ class api_v3_LineItemTest extends CiviUnitTestCase { $deleteParams = array('id' => $getResult['id']); $deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } public function testGetFieldsLineItem() { diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index 39b0b10436..8f5d0123be 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -65,12 +65,12 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { 'id' => $id, ); $membershiptype = $this->callAPIAndDocument('membership_type', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($membershiptype['values'][$id]['name'], 'General', 'In line ' . __LINE__ . " id is " . $id); + $this->assertEquals($membershiptype['values'][$id]['name'], 'General' . " id is " . $id); $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]['duration_unit'], 'year', 'In line ' . __LINE__); - $this->assertEquals($membershiptype['values'][$id]['duration_interval'], '1', 'In line ' . __LINE__); - $this->assertEquals($membershiptype['values'][$id]['period_type'], 'rolling', 'In line ' . __LINE__); + $this->assertEquals($membershiptype['values'][$id]['duration_unit'], 'year'); + $this->assertEquals($membershiptype['values'][$id]['duration_interval'], '1'); + $this->assertEquals($membershiptype['values'][$id]['period_type'], 'rolling'); $this->membershipTypeDelete($params); } diff --git a/tests/phpunit/api/v3/MessageTemplateTest.php b/tests/phpunit/api/v3/MessageTemplateTest.php index 1c35d44915..00e59a5846 100644 --- a/tests/phpunit/api/v3/MessageTemplateTest.php +++ b/tests/phpunit/api/v3/MessageTemplateTest.php @@ -74,8 +74,8 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { */ public function testGet() { $result = $this->callAPIAndDocument('MessageTemplate', 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); } /** @@ -87,7 +87,7 @@ class api_v3_MessageTemplateTest extends CiviUnitTestCase { $checkDeleted = $this->callAPISuccess($this->entity, 'get', array( 'id' => $entity['id'], )); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } } diff --git a/tests/phpunit/api/v3/NoteTest.php b/tests/phpunit/api/v3/NoteTest.php index 87214f6173..361c927535 100644 --- a/tests/phpunit/api/v3/NoteTest.php +++ b/tests/phpunit/api/v3/NoteTest.php @@ -134,8 +134,8 @@ class api_v3_NoteTest extends CiviUnitTestCase { public function testCreate() { $result = $this->callAPIAndDocument('note', 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertEquals($result['values'][$result['id']]['note'], 'Hello!!! m testing Note', 'in line ' . __LINE__); - $this->assertEquals(date('Y-m-d', strtotime($this->_params['modified_date'])), date('Y-m-d', strtotime($result['values'][$result['id']]['modified_date'])), 'in line ' . __LINE__); + $this->assertEquals($result['values'][$result['id']]['note'], 'Hello!!! m testing Note'); + $this->assertEquals(date('Y-m-d', strtotime($this->_params['modified_date'])), date('Y-m-d', strtotime($result['values'][$result['id']]['modified_date']))); $this->assertArrayHasKey('id', $result); $note = array( @@ -156,8 +156,8 @@ class api_v3_NoteTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('Note', 'Create', $params); $this->assertAPISuccess($result, 'in line ' . __LINE__); - $this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note", 'in line ' . __LINE__); - $this->assertEquals($result['values'][0]['subject'], "With a '", 'in line ' . __LINE__); + $this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note"); + $this->assertEquals($result['values'][0]['subject'], "With a '"); $this->assertArrayHasKey('id', $result, 'in line ' . __LINE__); //CleanUP @@ -221,9 +221,9 @@ class api_v3_NoteTest extends CiviUnitTestCase { $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['values'][$this->_noteID]['entity_table'], 'civicrm_contact', 'in line ' . __LINE__); - $this->assertEquals('Hello World', $note['values'][$this->_noteID]['subject'], 'in line ' . __LINE__); - $this->assertEquals('Note1', $note['values'][$this->_noteID]['note'], 'in line ' . __LINE__); + $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/OptionGroupTest.php b/tests/phpunit/api/v3/OptionGroupTest.php index a84e114537..04c77052e3 100644 --- a/tests/phpunit/api/v3/OptionGroupTest.php +++ b/tests/phpunit/api/v3/OptionGroupTest.php @@ -50,36 +50,36 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase { */ public function testGetOptionGroupGetFields() { $result = $this->callAPISuccess('option_group', 'getfields', array()); - $this->assertFalse(empty($result['values']), 'In line ' . __LINE__); + $this->assertFalse(empty($result['values'])); } public function testGetOptionGroupGetFieldsCreateAction() { $result = $this->callAPISuccess('option_group', 'getfields', array('action' => 'create')); - $this->assertFalse(empty($result['values']), 'In line ' . __LINE__); + $this->assertFalse(empty($result['values'])); $this->assertEquals($result['values']['name']['api.unique'], 1); } public function testGetOptionGroupByID() { $result = $this->callAPISuccess('option_group', 'get', array('id' => 1)); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals(1, $result['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals(1, $result['id']); } public function testGetOptionGroupByName() { $params = array('name' => 'preferred_communication_method'); $result = $this->callAPIAndDocument('option_group', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals(1, $result['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals(1, $result['id']); } public function testGetOptionGroup() { $result = $this->callAPISuccess('option_group', 'get', array()); - $this->assertGreaterThan(1, $result['count'], 'In line ' . __LINE__); + $this->assertGreaterThan(1, $result['count']); } public function testGetOptionDoesNotExist() { $result = $this->callAPISuccess('option_group', 'get', array('name' => 'FSIGUBSFGOMUUBSFGMOOUUBSFGMOOBUFSGMOOIIB')); - $this->assertEquals(0, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $result['count']); } public function testGetOptionCreateSuccess() { @@ -97,7 +97,7 @@ class api_v3_OptionGroupTest extends CiviUnitTestCase { ), ); $result = $this->callAPIAndDocument('OptionGroup', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals('civicrm_event.amount.560', $result['values'][0]['name'], 'In line ' . __LINE__); + $this->assertEquals('civicrm_event.amount.560', $result['values'][0]['name']); $this->assertTrue(is_int($result['values'][0]['api.OptionValue.create'])); $this->assertGreaterThan(0, $result['values'][0]['api.OptionValue.create']); $this->callAPISuccess('OptionGroup', 'delete', array('id' => $result['id'])); diff --git a/tests/phpunit/api/v3/OptionValueTest.php b/tests/phpunit/api/v3/OptionValueTest.php index be44d7f3e7..5048338826 100644 --- a/tests/phpunit/api/v3/OptionValueTest.php +++ b/tests/phpunit/api/v3/OptionValueTest.php @@ -45,14 +45,14 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { public function testGetOptionValueByID() { $result = $this->callAPISuccess('option_value', 'get', array('id' => 1)); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals(1, $result['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals(1, $result['id']); } public function testGetOptionValueByValue() { $result = $this->callAPISuccess('option_value', 'get', array('option_group_id' => 1, 'value' => '1')); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertEquals(1, $result['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertEquals(1, $result['id']); } /** @@ -133,7 +133,7 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { public function testGetOptionGroup() { $params = array('option_group_id' => 1); $result = $this->callAPIAndDocument('option_value', 'get', $params, __FUNCTION__, __FILE__); - $this->assertGreaterThan(1, $result['count'], 'In line ' . __LINE__); + $this->assertGreaterThan(1, $result['count']); } /** @@ -144,13 +144,13 @@ class api_v3_OptionValueTest extends CiviUnitTestCase { $params = array('option.limit' => 100); $activityTypes = $this->callAPISuccess('option_value', 'get', $activityTypesParams); $result = $this->callAPISuccess('option_value', 'get', $params); - $this->assertGreaterThan(1, $activityTypes['count'], 'In line ' . __LINE__); - $this->assertGreaterThan($activityTypes['count'], $result['count'], 'In line ' . __LINE__); + $this->assertGreaterThan(1, $activityTypes['count']); + $this->assertGreaterThan($activityTypes['count'], $result['count']); } public function testGetOptionDoesNotExist() { $result = $this->callAPISuccess('option_value', 'get', array('label' => 'FSIGUBSFGOMUUBSFGMOOUUBSFGMOOBUFSGMOOIIB')); - $this->assertEquals(0, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $result['count']); } /** diff --git a/tests/phpunit/api/v3/ParticipantPaymentTest.php b/tests/phpunit/api/v3/ParticipantPaymentTest.php index 573e2df435..193b030043 100644 --- a/tests/phpunit/api/v3/ParticipantPaymentTest.php +++ b/tests/phpunit/api/v3/ParticipantPaymentTest.php @@ -118,7 +118,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('participant_payment', 'create', $params, __FUNCTION__, __FILE__); - $this->assertTrue(array_key_exists('id', $result), 'in line ' . __LINE__); + $this->assertTrue(array_key_exists('id', $result)); //delete created contribution $this->contributionDelete($contributionID); @@ -133,7 +133,7 @@ class api_v3_ParticipantPaymentTest extends CiviUnitTestCase { public function testPaymentUpdateWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant_payment', 'create', $params); - $this->assertEquals('Input variable `params` is not an array', $result['error_message'], 'In line ' . __LINE__); + $this->assertEquals('Input variable `params` is not an array', $result['error_message']); } /** diff --git a/tests/phpunit/api/v3/ParticipantStatusTypeTest.php b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php index 099d029751..672c985b3c 100644 --- a/tests/phpunit/api/v3/ParticipantStatusTypeTest.php +++ b/tests/phpunit/api/v3/ParticipantStatusTypeTest.php @@ -55,17 +55,17 @@ class api_v3_ParticipantStatusTypeTest extends CiviUnitTestCase { public function testCreateParticipantStatusType() { $result = $this->callAPIAndDocument('participant_status_type', 'create', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); } public function testGetParticipantStatusType() { $result = $this->callAPIAndDocument('participant_status_type', 'create', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $result = $this->callAPIAndDocument('participant_status_type', 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->id = $result['id']; } @@ -76,7 +76,7 @@ class api_v3_ParticipantStatusTypeTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('participant_status_type', 'delete', array('id' => $ParticipantStatusType['id']), __FUNCTION__, __FILE__); $getCheck = $this->callAPISuccess('ParticipantStatusType', 'GET', array('id' => $ParticipantStatusType['id'])); $checkDeleted = $this->callAPISuccess('ParticipantStatusType', 'Get', array()); - $this->assertEquals($entity['count'] - 1, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals($entity['count'] - 1, $checkDeleted['count']); } } diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 6fdddc869f..a0fb7722d3 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -574,7 +574,7 @@ class api_v3_ParticipantTest extends CiviUnitTestCase { public function testUpdateWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('participant', 'create', $params); - $this->assertEquals('Input variable `params` is not an array', $result['error_message'], 'In line ' . __LINE__); + $this->assertEquals('Input variable `params` is not an array', $result['error_message']); } /** diff --git a/tests/phpunit/api/v3/PaymentProcessorTest.php b/tests/phpunit/api/v3/PaymentProcessorTest.php index 0e1285d4b2..ab51fbce95 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTest.php @@ -76,7 +76,7 @@ class api_v3_PaymentProcessorTest extends CiviUnitTestCase { public function testPaymentProcessorCreate() { $params = $this->_params; $result = $this->callAPIAndDocument('payment_processor', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['id']); //assertDBState compares expected values in $result to actual values in the DB $this->assertDBState('CRM_Financial_DAO_PaymentProcessor', $result['id'], $params); diff --git a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php index 5cc2a0e3a2..b41273cd91 100644 --- a/tests/phpunit/api/v3/PaymentProcessorTypeTest.php +++ b/tests/phpunit/api/v3/PaymentProcessorTypeTest.php @@ -78,7 +78,7 @@ class api_v3_PaymentProcessorTypeTest extends CiviUnitTestCase { 'is_recur' => 0, ); $result = $this->callAPIAndDocument('payment_processor_type', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['values'][0]['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['values'][0]['id']); // mutate $params to match expected return value unset($params['sequential']); diff --git a/tests/phpunit/api/v3/PhoneTest.php b/tests/phpunit/api/v3/PhoneTest.php index a309127500..604ed88784 100644 --- a/tests/phpunit/api/v3/PhoneTest.php +++ b/tests/phpunit/api/v3/PhoneTest.php @@ -63,8 +63,8 @@ class api_v3_PhoneTest extends CiviUnitTestCase { public function testCreatePhone() { $result = $this->callAPIAndDocument('phone', 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->callAPISuccess('phone', 'delete', array('id' => $result['id'])); } @@ -74,7 +74,7 @@ class api_v3_PhoneTest extends CiviUnitTestCase { $create = $this->callAPISuccess('phone', 'create', $this->_params); $result = $this->callAPIAndDocument('phone', 'delete', array('id' => $create['id']), __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $get = $this->callAPISuccess('phone', 'get', array( 'id' => $create['id'], 'location_type_id' => $this->_locationType, @@ -108,10 +108,10 @@ class api_v3_PhoneTest extends CiviUnitTestCase { 'phone' => $phone['values'][$phone['id']]['phone'], ); $result = $this->callAPIAndDocument('Phone', 'Get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($phone['values'][$phone['id']]['location_type_id'], $result['values'][$phone['id']]['location_type_id'], 'In line ' . __LINE__); - $this->assertEquals($phone['values'][$phone['id']]['phone_type_id'], $result['values'][$phone['id']]['phone_type_id'], 'In line ' . __LINE__); - $this->assertEquals($phone['values'][$phone['id']]['is_primary'], $result['values'][$phone['id']]['is_primary'], 'In line ' . __LINE__); - $this->assertEquals($phone['values'][$phone['id']]['phone'], $result['values'][$phone['id']]['phone'], 'In line ' . __LINE__); + $this->assertEquals($phone['values'][$phone['id']]['location_type_id'], $result['values'][$phone['id']]['location_type_id']); + $this->assertEquals($phone['values'][$phone['id']]['phone_type_id'], $result['values'][$phone['id']]['phone_type_id']); + $this->assertEquals($phone['values'][$phone['id']]['is_primary'], $result['values'][$phone['id']]['is_primary']); + $this->assertEquals($phone['values'][$phone['id']]['phone'], $result['values'][$phone['id']]['phone']); } ///////////////// civicrm_phone_create methods diff --git a/tests/phpunit/api/v3/PledgeTest.php b/tests/phpunit/api/v3/PledgeTest.php index 6a42875bfd..fac885bfb2 100644 --- a/tests/phpunit/api/v3/PledgeTest.php +++ b/tests/phpunit/api/v3/PledgeTest.php @@ -535,7 +535,7 @@ class api_v3_PledgeTest extends CiviUnitTestCase { $this->callAPISuccess('pledge', 'create', $this->_params); $result = $this->callAPISuccess('pledge', 'get', array()); $this->assertAPISuccess($result, "This test is failing because it's acting like a contact get when no params set. Not sure the fix"); - $this->assertEquals(1, $result['count'], 'in line ' . __LINE__); + $this->assertEquals(1, $result['count']); $pledgeID = array('id' => $result['id']); $this->callAPISuccess('pledge', 'delete', $pledgeID); } diff --git a/tests/phpunit/api/v3/PriceFieldTest.php b/tests/phpunit/api/v3/PriceFieldTest.php index f265fb3911..001155abdf 100644 --- a/tests/phpunit/api/v3/PriceFieldTest.php +++ b/tests/phpunit/api/v3/PriceFieldTest.php @@ -84,8 +84,8 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { public function testCreatePriceField() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->_params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->_params, $result['id'], $this->_entity); } @@ -97,7 +97,7 @@ class api_v3_PriceFieldTest extends CiviUnitTestCase { 'name' => 'contribution_amount', ); $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__); - $this->assertEquals(1, $getResult['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $getResult['count']); $this->callAPISuccess('price_field', 'delete', array('id' => $createResult['id'])); } diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index 7f99784e3f..0bae4231a6 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -138,8 +138,8 @@ 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->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->getAndCheck($this->_params, $result['id'], $this->_entity); } @@ -151,7 +151,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { 'name' => 'contribution_amount', ); $getResult = $this->callAPIAndDocument($this->_entity, 'get', $getParams, __FUNCTION__, __FILE__); - $this->assertEquals(1, $getResult['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $getResult['count']); $this->callAPISuccess('price_field_value', 'delete', array('id' => $createResult['id'])); } @@ -183,7 +183,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__); $this->assertEquals($result['values'][$result['id']]['membership_num_terms'], 2); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result['id'])); } @@ -211,7 +211,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { $result1 = $this->callAPISuccess($this->_entity, 'create', $params1); $result2 = $this->callAPISuccess($this->_entity, 'create', $params2); $result = $this->callAPISuccess($this->_entity, 'get', array('price_field_id' => $this->priceFieldID1)); - $this->assertEquals(2, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(2, $result['count']); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result1['id'])); $this->callAPISuccess($this->_entity, 'delete', array('id' => $result2['id'])); } diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index 42ac0a995f..3cac5b8c3b 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -121,7 +121,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { 'sequential' => 1, ); $result = $this->callAPIAndDocument('relationship_type', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['values'][0]['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['values'][0]['id']); unset($params['sequential']); //assertDBState compares expected values in $result to actual values in the DB $this->assertDBState('CRM_Contact_DAO_RelationshipType', $result['id'], $params); diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 75f7a97843..b4ff2efaea 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -51,10 +51,10 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'component' => 'CiviCase', )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $entityId = $result['id']; - $this->assertTrue(is_numeric($entityId), 'In line ' . __LINE__); - $this->assertEquals(7, $result['values'][$entityId]['component_id'], 'In line ' . __LINE__); + $this->assertTrue(is_numeric($entityId)); + $this->assertEquals(7, $result['values'][$entityId]['component_id']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez" AND option_group_id IN (SELECT id from civicrm_option_group WHERE name = "report_template") '); @@ -67,7 +67,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'component' => '', )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez" AND option_group_id IN (SELECT id from civicrm_option_group WHERE name = "report_template") '); @@ -81,7 +81,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'is_active' => 0, )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez" AND option_group_id IN (SELECT id from civicrm_option_group WHERE name = "report_template") '); @@ -94,7 +94,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'is_active' => 1, )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(1, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez" AND option_group_id IN (SELECT id from civicrm_option_group WHERE name = "report_template") '); @@ -105,7 +105,7 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { 'id' => $entityId, )); $this->assertAPISuccess($result); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->assertDBQuery(0, 'SELECT count(*) FROM civicrm_option_value WHERE name = "CRM_Report_Form_Examplez" '); diff --git a/tests/phpunit/api/v3/SurveyTest.php b/tests/phpunit/api/v3/SurveyTest.php index 4729a419ad..575fb78b28 100644 --- a/tests/phpunit/api/v3/SurveyTest.php +++ b/tests/phpunit/api/v3/SurveyTest.php @@ -88,8 +88,8 @@ class api_v3_SurveyTest extends CiviUnitTestCase { public function testGetSurvey() { $this->createTestEntity(); $result = $this->callAPIAndDocument('survey', 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); } /** @@ -99,7 +99,7 @@ class api_v3_SurveyTest extends CiviUnitTestCase { $entity = $this->createTestEntity(); $result = $this->callAPIAndDocument('survey', 'delete', array('id' => $entity['id']), __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess($this->entity, 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } /** @@ -118,7 +118,7 @@ class api_v3_SurveyTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('survey', 'create', $this->params); $result = $this->callAPIAndDocument('survey', 'get', $params, __FUNCTION__, __FILE__, $description, $subfile); - $this->assertEquals(0, $this->callAPISuccess('survey', 'getcount', array()), 'In line ' . __LINE__); + $this->assertEquals(0, $this->callAPISuccess('survey', 'getcount', array())); } } diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 2af8c8b677..239d9ad529 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -615,7 +615,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { */ public function testNotImplemented_get($Entity) { $result = civicrm_api($Entity, 'Get', array('version' => 3)); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); // $this->assertContains("API ($Entity, Get) does not exist", $result['error_message']); $this->assertRegExp('/API (.*) does not exist/', $result['error_message']); } @@ -657,7 +657,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return; } $result = civicrm_api($Entity, 'Get', array()); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertContains("Mandatory key(s) missing from params array", $result['error_message']); } @@ -998,7 +998,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { */ public function testNotImplemented_create($Entity) { $result = civicrm_api($Entity, 'Create', array('version' => 3)); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertContains(strtolower("API ($Entity, Create) does not exist"), strtolower($result['error_message'])); } @@ -1053,7 +1053,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { */ public function testCreateWrongTypeParamTag_create() { $result = civicrm_api("Tag", 'Create', 'this is not a string'); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertEquals("Input variable `params` is not an array", $result['error_message']); } @@ -1258,7 +1258,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { public function testNotImplemented_delete($Entity) { $nonExistantID = 151416349; $result = civicrm_api($Entity, 'Delete', array('version' => 3, 'id' => $nonExistantID)); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertContains(strtolower("API ($Entity, Delete) does not exist"), strtolower($result['error_message'])); } @@ -1282,7 +1282,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { return; } $result = civicrm_api($Entity, 'Delete', array()); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertContains("Mandatory key(s) missing from params array", $result['error_message']); } @@ -1307,7 +1307,7 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { */ public function testDeleteWrongTypeParamTag_delete() { $result = civicrm_api("Tag", 'Delete', 'this is not a string'); - $this->assertEquals(1, $result['is_error'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['is_error']); $this->assertEquals("Input variable `params` is not an array", $result['error_message']); } diff --git a/tests/phpunit/api/v3/TagTest.php b/tests/phpunit/api/v3/TagTest.php index 9702405ef2..61539ba33b 100644 --- a/tests/phpunit/api/v3/TagTest.php +++ b/tests/phpunit/api/v3/TagTest.php @@ -74,7 +74,7 @@ class api_v3_TagTest extends CiviUnitTestCase { 'name' => $this->tag['name'], ); $result = $this->callAPIAndDocument('tag', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($this->tag['description'], $result['values'][$this->tagID]['description'], 'In line ' . __LINE__); + $this->assertEquals($this->tag['description'], $result['values'][$this->tagID]['description']); $this->assertEquals($this->tag['name'], $result['values'][$this->tagID]['name']); } @@ -114,7 +114,7 @@ class api_v3_TagTest extends CiviUnitTestCase { 'description' => 'This is description for New Tag 02', ); $result = $this->callAPISuccess('tag', 'create', $params); - $this->assertEquals(10, $result['id'], 'In line ' . __LINE__); + $this->assertEquals(10, $result['id']); } /** @@ -196,9 +196,9 @@ class api_v3_TagTest extends CiviUnitTestCase { 'extra' => array('used_for'), ); $result = $this->callAPIAndDocument('tag', 'getlist', $params, __FUNCTION__, __FILE__, $description); - $this->assertEquals($this->tag['id'], $result['values'][0]['id'], 'In line ' . __LINE__); - $this->assertEquals($this->tag['description'], $result['values'][0]['description'][0], 'In line ' . __LINE__); - $this->assertEquals($this->tag['used_for'], $result['values'][0]['extra']['used_for'], 'In line ' . __LINE__); + $this->assertEquals($this->tag['id'], $result['values'][0]['id']); + $this->assertEquals($this->tag['description'], $result['values'][0]['description'][0]); + $this->assertEquals($this->tag['used_for'], $result['values'][0]['extra']['used_for']); } } diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 15fcd9702f..92567661eb 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -260,7 +260,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $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']]['source'], 'SSF', 'In line ' . __LINE__); + $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->_checkFinancialRecords($contribution, 'online'); @@ -329,7 +329,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $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']]['source'], 'SSF', 'In line ' . __LINE__); + $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->_checkFinancialRecords($contribution, 'payLater'); @@ -355,7 +355,7 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { $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']]['source'], 'SSF', 'In line ' . __LINE__); + $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->_checkFinancialRecords($contribution, 'pending'); diff --git a/tests/phpunit/api/v3/UFGroupTest.php b/tests/phpunit/api/v3/UFGroupTest.php index 284ff9404c..16ddacacd8 100644 --- a/tests/phpunit/api/v3/UFGroupTest.php +++ b/tests/phpunit/api/v3/UFGroupTest.php @@ -117,8 +117,8 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('uf_group', 'create', $this->params, __FUNCTION__, __FILE__); $this->assertAPISuccess($result); - $this->assertEquals($result['values'][$result['id']]['add_to_group_id'], $this->params['add_contact_to_group'], 'in line ' . __LINE__); - $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $this->params['group'], 'in line ' . __LINE__); + $this->assertEquals($result['values'][$result['id']]['add_to_group_id'], $this->params['add_contact_to_group']); + $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $this->params['group']); $this->params['created_date'] = date('YmdHis', strtotime($this->params['created_date'])); foreach ($this->params as $key => $value) { if ($key == 'add_contact_to_group' or $key == 'group') { @@ -171,16 +171,16 @@ class api_v3_UFGroupTest extends CiviUnitTestCase { $this->assertEquals($result['values'][$result['id']][$key], $params[$key], $key . " doesn't match " . $value); } - $this->assertEquals($result['values'][$this->_ufGroupId]['add_to_group_id'], $params['add_contact_to_group'], 'in line ' . __LINE__); - $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $params['group'], 'in line ' . __LINE__); + $this->assertEquals($result['values'][$this->_ufGroupId]['add_to_group_id'], $params['add_contact_to_group']); + $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $params['group']); } public function testUFGroupGet() { $result = $this->callAPISuccess('uf_group', 'create', $this->params); $params = array('id' => $result['id']); $result = $this->callAPIAndDocument('uf_group', 'get', $params, __FUNCTION__, __FILE__); - $this->assertEquals($result['values'][$result['id']]['add_to_group_id'], $this->params['add_contact_to_group'], 'in line ' . __LINE__); - $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $this->params['group'], 'in line ' . __LINE__); + $this->assertEquals($result['values'][$result['id']]['add_to_group_id'], $this->params['add_contact_to_group']); + $this->assertEquals($result['values'][$result['id']]['limit_listings_group_id'], $this->params['group']); foreach ($this->params as $key => $value) { // skip created date because it doesn't seem to be working properly & fixing date handling is for another day if ($key == 'add_contact_to_group' or $key == 'group' or $key == 'created_date') { diff --git a/tests/phpunit/api/v3/UFJoinTest.php b/tests/phpunit/api/v3/UFJoinTest.php index 319c5186e4..d4a446f1cb 100644 --- a/tests/phpunit/api/v3/UFJoinTest.php +++ b/tests/phpunit/api/v3/UFJoinTest.php @@ -103,13 +103,13 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { public function testUFJoinEditWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('uf_join', 'create', $params); - $this->assertEquals($result['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Input variable `params` is not an array'); } public function testUFJoinEditEmptyParams() { $params = array(); $result = $this->callAPIFailure('uf_join', 'create', $params); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: module, weight, uf_group_id', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: module, weight, uf_group_id'); } public function testUFJoinEditWithoutUFGroupId() { @@ -121,7 +121,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'is_active' => 1, ); $result = $this->callAPIFailure('uf_join', 'create', $params); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id'); } /** @@ -138,9 +138,9 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'sequential' => 1, ); $ufJoin = $this->callAPIAndDocument('uf_join', 'create', $params, __FUNCTION__, __FILE__); - $this->assertEquals($ufJoin['values'][0]['module'], $params['module'], 'In line ' . __LINE__); - $this->assertEquals($ufJoin['values'][0]['uf_group_id'], $params['uf_group_id'], 'In line ' . __LINE__); - $this->assertEquals($ufJoin['values'][0]['is_active'], $params['is_active'], 'In line ' . __LINE__); + $this->assertEquals($ufJoin['values'][0]['module'], $params['module']); + $this->assertEquals($ufJoin['values'][0]['uf_group_id'], $params['uf_group_id']); + $this->assertEquals($ufJoin['values'][0]['is_active'], $params['is_active']); $params = array( 'id' => $ufJoin['id'], @@ -153,21 +153,21 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'sequential' => 1, ); $ufJoinUpdated = $this->callAPISuccess('uf_join', 'create', $params); - $this->assertEquals($ufJoinUpdated['values'][0]['module'], $params['module'], 'In line ' . __LINE__); - $this->assertEquals($ufJoinUpdated['values'][0]['uf_group_id'], $params['uf_group_id'], 'In line ' . __LINE__); - $this->assertEquals($ufJoinUpdated['values'][0]['is_active'], $params['is_active'], 'In line ' . __LINE__); + $this->assertEquals($ufJoinUpdated['values'][0]['module'], $params['module']); + $this->assertEquals($ufJoinUpdated['values'][0]['uf_group_id'], $params['uf_group_id']); + $this->assertEquals($ufJoinUpdated['values'][0]['is_active'], $params['is_active']); } public function testFindUFJoinWrongParamsType() { $params = 'a string'; $result = $this->callAPIFailure('uf_join', 'create', $params); - $this->assertEquals($result['error_message'], 'Input variable `params` is not an array', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Input variable `params` is not an array'); } public function testFindUFJoinEmptyParams() { $result = $this->callAPIFailure('uf_join', 'create', array()); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: module, weight, uf_group_id', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: module, weight, uf_group_id'); } public function testFindUFJoinWithoutUFGroupId() { @@ -179,7 +179,7 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { 'is_active' => 1, ); $result = $this->callAPIFailure('uf_join', 'create', $params); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id', 'In line ' . __LINE__); + $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: uf_group_id'); } /** @@ -203,9 +203,9 @@ class api_v3_UFJoinTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('uf_join', 'get', $searchParams, __FUNCTION__, __FILE__); - $this->assertEquals($result['values'][0]['module'], $params['module'], 'In line ' . __LINE__); - $this->assertEquals($result['values'][0]['uf_group_id'], $params['uf_group_id'], 'In line ' . __LINE__); - $this->assertEquals($result['values'][0]['entity_id'], $params['entity_id'], 'In line ' . __LINE__); + $this->assertEquals($result['values'][0]['module'], $params['module']); + $this->assertEquals($result['values'][0]['uf_group_id'], $params['uf_group_id']); + $this->assertEquals($result['values'][0]['entity_id'], $params['entity_id']); } /** diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index 1d6b73872d..4589c2ed30 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -261,7 +261,7 @@ class api_v3_UtilsTest extends CiviUnitTestCase { $fields = civicrm_api3('Membership', 'getfields', array('action' => 'get')); _civicrm_api3_validate_fields('Membership', 'get', $params, $fields['values']); $this->assertEquals('2010-12-20', $params['start_date']); - $this->assertEquals('20101220000000', $params['membership_start_date'], 'in line ' . __LINE__); + $this->assertEquals('20101220000000', $params['membership_start_date']); $this->assertEquals('', $params['end_date']); $this->assertEquals('20101220000000', $params['join_date'], 'join_date not set in line ' . __LINE__); } @@ -276,9 +276,9 @@ class api_v3_UtilsTest extends CiviUnitTestCase { ); $fields = civicrm_api3('Event', 'getfields', array('action' => 'create')); _civicrm_api3_validate_fields('event', 'create', $params, $fields['values']); - $this->assertEquals('20101220000000', $params['start_date'], 'in line ' . __LINE__); - $this->assertEquals('20081015000000', $params['registration_end_date'], 'in line ' . __LINE__); - $this->assertEquals('', $params['end_date'], 'in line ' . __LINE__); + $this->assertEquals('20101220000000', $params['start_date']); + $this->assertEquals('20081015000000', $params['registration_end_date']); + $this->assertEquals('', $params['end_date']); $this->assertEquals('20080601000000', $params['registration_start_date']); } diff --git a/tests/phpunit/api/v3/WebsiteTest.php b/tests/phpunit/api/v3/WebsiteTest.php index daf1856def..67df5e1aae 100644 --- a/tests/phpunit/api/v3/WebsiteTest.php +++ b/tests/phpunit/api/v3/WebsiteTest.php @@ -57,16 +57,16 @@ class api_v3_WebsiteTest extends CiviUnitTestCase { public function testCreateWebsite() { $result = $this->callAPIAndDocument($this->_entity, 'create', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); $this->getAndCheck($this->params, $result['id'], $this->_entity); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['values'][$result['id']]['id']); } public function testGetWebsite() { $result = $this->callAPISuccess($this->_entity, 'create', $this->params); $result = $this->callAPIAndDocument($this->_entity, 'get', $this->params, __FUNCTION__, __FILE__); - $this->assertEquals(1, $result['count'], 'In line ' . __LINE__); - $this->assertNotNull($result['values'][$result['id']]['id'], 'In line ' . __LINE__); + $this->assertEquals(1, $result['count']); + $this->assertNotNull($result['values'][$result['id']]['id']); $this->callAPISuccess('website', 'delete', array('id' => $result['id'])); } @@ -75,7 +75,7 @@ class api_v3_WebsiteTest extends CiviUnitTestCase { $deleteParams = array('id' => $result['id']); $result = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(0, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(0, $checkDeleted['count']); } public function testDeleteWebsiteInvalid() { @@ -83,7 +83,7 @@ class api_v3_WebsiteTest extends CiviUnitTestCase { $deleteParams = array('id' => 600); $result = $this->callAPIFailure($this->_entity, 'delete', $deleteParams); $checkDeleted = $this->callAPISuccess($this->_entity, 'get', array()); - $this->assertEquals(1, $checkDeleted['count'], 'In line ' . __LINE__); + $this->assertEquals(1, $checkDeleted['count']); } /** -- 2.25.1