diff --git a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php index 19fd01bafad3..d4faf29fa7f9 100644 --- a/tests/phpunit/CRM/Activity/BAO/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/BAO/ActivityTest.php @@ -18,7 +18,7 @@ class CRM_Activity_BAO_ActivityTest extends CiviUnitTestCase { /** * Set up for test. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp():void { parent::setUp(); @@ -30,7 +30,7 @@ public function setUp():void { /** * Clean up after tests. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function tearDown(): void { @@ -252,7 +252,6 @@ public function testActivitySelectorNoTargets() { * deleteActivity($params) method deletes activity for given params. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteActivity() { $contactId = $this->individualCreate(); @@ -362,7 +361,6 @@ public function testDeleteActivityTarget() { * for given activity id. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteActivityAssignment(): void { $contactId = $this->individualCreate(); @@ -1077,7 +1075,6 @@ public function testByActivityDateAndStatus(): void { * @param $expected * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testActivityRelativeDateFilter($params, $expected): void { $thisYear = date('Y'); @@ -1138,7 +1135,6 @@ public function getActivityDateData() { * CRM-20308: Test from email address when a 'copy of Activity' event occur * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testEmailAddressOfActivityCopy() { // Case 1: assert the 'From' Email Address of source Actvity Contact ID @@ -1218,9 +1214,7 @@ protected function setUpForActivityDashboardTests() { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSendEmailBasic(): void { $contactId = $this->getContactID(); @@ -1312,9 +1306,7 @@ protected function getContactID(): int { * This is different from SentEmailBasic to try to help prevent code that * assumes an email always has tokens in it. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSendEmailBasicWithoutAnyTokens(): void { @@ -1358,9 +1350,7 @@ public function testSendEmailBasicWithoutAnyTokens(): void { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSendEmailWithCampaign(): void { // Create a contact and contactDetails array. @@ -1415,9 +1405,7 @@ public function testSendSMSWithoutPermission(): void { /** * Test that a sms does not send when a phone number is not available. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSendSmsNoPhoneNumber(): void { @@ -1426,9 +1414,7 @@ public function testSendSmsNoPhoneNumber(): void { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSendSmsLandLinePhoneNumber(): void { @@ -1439,9 +1425,7 @@ public function testSendSmsLandLinePhoneNumber(): void { /** * Test successful SMS send. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSendSmsMobilePhoneNumber(): void { @@ -1481,9 +1465,7 @@ public function testSendSMSMobileInToProviderParamWithDoNotSMS(): void { * @param array $additionalContactParams additional contact creation params * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function createSendSmsTest(bool $expectSuccess = TRUE, int $phoneType = 0, bool $passPhoneTypeInContactDetails = FALSE, array $additionalContactParams = []): array { @@ -1699,7 +1681,6 @@ public function testSendEmailWillReplaceTokensUniquelyForEachContact(): void { * 3 recipients and an attachment. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSendEmailWillReplaceTokensUniquelyForEachContact3(): void { $contactId1 = $this->individualCreate(['last_name' => 'Red']); @@ -1933,7 +1914,7 @@ protected function setShowCaseActivitiesInCore(bool $val) { * @param array $do_first * @param array $do_second * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testTargetAssigneeVariations(array $do_first, array $do_second) { // Originally wanted to put this in setUp() but it broke other tests. @@ -2002,7 +1983,6 @@ public function testTargetAssigneeVariations(array $do_first, array $do_second) * @param array $do_second * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testTargetAssigneeVariationsWithScalars(array $do_first, array $do_second) { // Originally wanted to put this in setUp() but it broke other tests. @@ -2596,7 +2576,7 @@ public function targetAndAssigneeProvider():array { /** * @param $activityId * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function validateActivity($activityId): void { @@ -2620,7 +2600,7 @@ protected function validateActivity($activityId): void { * @param $contactDetails * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function createMobilePhone(int $contactId, bool $passPhoneTypeInContactDetails, $contactDetails): array { $phone = civicrm_api3('Phone', 'create', [ diff --git a/tests/phpunit/CRM/Activity/Form/ActivityTest.php b/tests/phpunit/CRM/Activity/Form/ActivityTest.php index 13dec5a99ac1..12190a9e1867 100644 --- a/tests/phpunit/CRM/Activity/Form/ActivityTest.php +++ b/tests/phpunit/CRM/Activity/Form/ActivityTest.php @@ -305,7 +305,6 @@ public function testActivityTypeAssignment() { * way to do it. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testInboundEmailDisplaysWithLineBreaks(): void { // Change label diff --git a/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php b/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php index 88c8e0e318fc..d52d6f7571fa 100644 --- a/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php +++ b/tests/phpunit/CRM/Activity/Form/ActivityViewTest.php @@ -24,7 +24,6 @@ public function tearDown(): void { * after preProcess(). * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testActivityViewPreProcess(): void { // create activity diff --git a/tests/phpunit/CRM/Activity/Form/SearchTest.php b/tests/phpunit/CRM/Activity/Form/SearchTest.php index 23792a6debbb..812ca7badf31 100644 --- a/tests/phpunit/CRM/Activity/Form/SearchTest.php +++ b/tests/phpunit/CRM/Activity/Form/SearchTest.php @@ -28,7 +28,6 @@ public function tearDown(): void { * Test submitted the search form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSearch(): void { diff --git a/tests/phpunit/CRM/Activity/Form/Task/PDFLetterCommonTest.php b/tests/phpunit/CRM/Activity/Form/Task/PDFLetterCommonTest.php index c8bfda9d215c..dd3b6723d81c 100644 --- a/tests/phpunit/CRM/Activity/Form/Task/PDFLetterCommonTest.php +++ b/tests/phpunit/CRM/Activity/Form/Task/PDFLetterCommonTest.php @@ -20,7 +20,6 @@ public function setUp(): void { * Test create a document with basic tokens. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateDocumentBasicTokens(): void { CRM_Core_BAO_ConfigSetting::enableComponent('CiviCase'); @@ -121,7 +120,6 @@ public function testCreateDocumentCustomFieldTokens() { * Unknown tokens are removed at the very end. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateDocumentUnknownTokens(): void { $activity = $this->activityCreate(); diff --git a/tests/phpunit/CRM/Activity/Selector/SearchTest.php b/tests/phpunit/CRM/Activity/Selector/SearchTest.php index 584d6184b646..44728353e8ab 100644 --- a/tests/phpunit/CRM/Activity/Selector/SearchTest.php +++ b/tests/phpunit/CRM/Activity/Selector/SearchTest.php @@ -20,7 +20,6 @@ class CRM_Activity_Selector_SearchTest extends CiviUnitTestCase { * Test activity search applies a permission based component filter. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testActivitySearchComponentPermission() { $this->activityCreate(['activity_type_id' => 'Contribution']); diff --git a/tests/phpunit/CRM/Batch/Form/EntryTest.php b/tests/phpunit/CRM/Batch/Form/EntryTest.php index ba9bc9e80ec5..14c461f4be77 100644 --- a/tests/phpunit/CRM/Batch/Form/EntryTest.php +++ b/tests/phpunit/CRM/Batch/Form/EntryTest.php @@ -84,7 +84,6 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); @@ -176,7 +175,6 @@ public function tearDown(): void { * * @param string $thousandSeparator * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @@ -256,7 +254,6 @@ public function testProcessContribution($thousandSeparator): void { /** * CRM-18000 - Test start_date, end_date after renewal * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -307,7 +304,7 @@ public function testMembershipRenewalDates(): void { * Data provider for test process membership. * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function getMembershipData(): array { @@ -424,7 +421,7 @@ public function getContributionData($thousandSeparator = '.') { * Create a campaign. * * @return mixed - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function createCampaign(): int { diff --git a/tests/phpunit/CRM/Case/WorkflowMessage/CaseActivityTest.php b/tests/phpunit/CRM/Case/WorkflowMessage/CaseActivityTest.php index 0ecb327b653b..687ec43ae7fa 100644 --- a/tests/phpunit/CRM/Case/WorkflowMessage/CaseActivityTest.php +++ b/tests/phpunit/CRM/Case/WorkflowMessage/CaseActivityTest.php @@ -48,7 +48,7 @@ public function testConstructorEquivalence() { /** * Basic canary test fetching a specific example. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testExampleGet() { diff --git a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php index 5be8e8980f06..6c266845b9d2 100644 --- a/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php +++ b/tests/phpunit/CRM/Contact/BAO/ContactType/ContactTypeTest.php @@ -48,7 +48,7 @@ public function setUp(): void { /** * Cleanup contact types. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function tearDown(): void { @@ -103,7 +103,7 @@ public function testGetMethodsInvalid() { /** * Test function for getting contact types. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testContactTypeInfo() { $blahType = ['is_active' => 0, 'name' => 'blah', 'label' => 'blah blah', 'parent_id:name' => 'Individual', 'icon' => 'fa-random']; diff --git a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php index 0583354b4e23..4ef56a5f5318 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupContactCacheTest.php @@ -22,9 +22,7 @@ class CRM_Contact_BAO_GroupContactCacheTest extends CiviUnitTestCase { /** * Manually add and remove contacts from a smart group. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testManualAddRemove(): void { [$group, $living, $deceased] = $this->setupSmartGroup(); @@ -63,9 +61,7 @@ public function testManualAddRemove(): void { * Allow removing contact from a parent group even if contact is in a child * group. (CRM-8858). * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testRemoveFromParentSmartGroup(): void { // Create $c1, $c2, $c3 @@ -186,7 +182,7 @@ public function testOpportunisticRefreshChangeIfCacheDateFieldStale(): void { * Test the opportunistic refresh cache function does refresh expired entries * if mode is deterministic. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testOpportunisticRefreshNoChangeWithDeterministicSetting(): void { [, , $deceased] = $this->setupSmartGroup(); @@ -291,7 +287,7 @@ protected function setupSmartGroup(): array { ); return [$group, $living, $deceased]; } - catch (CRM_Core_Exception | API_Exception | CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception | CRM_Core_Exception | CRM_Core_Exception $e) { $this->fail('failed test setup' . $e->getMessage()); } // unreachable but it cheers up IDE analysis. diff --git a/tests/phpunit/CRM/Contact/BAO/GroupTest.php b/tests/phpunit/CRM/Contact/BAO/GroupTest.php index 6408583617a1..ddde07352d2f 100644 --- a/tests/phpunit/CRM/Contact/BAO/GroupTest.php +++ b/tests/phpunit/CRM/Contact/BAO/GroupTest.php @@ -161,7 +161,7 @@ public function testNestedGroup(): void { /** * Test that parents as criteria don't cause loops. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGroupWithParentInCriteria(): void { $parentGroupID = Group::create()->setValues([ diff --git a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php index d0091ccca478..73b59f6d1a2e 100644 --- a/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php +++ b/tests/phpunit/CRM/Contact/Form/Search/Custom/GroupTest.php @@ -37,7 +37,6 @@ class CRM_Contact_Form_Search_Custom_GroupTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $this->quickCleanup([ diff --git a/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php b/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php index d04ab9032de0..2c807b24d1dd 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/EmailTest.php @@ -59,9 +59,7 @@ public function testDomainEmailGeneration(): void { /** * Test email uses signature. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testPostProcessWithSignature(): void { diff --git a/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php b/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php index d475141f05b4..f2739cb97b29 100644 --- a/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php +++ b/tests/phpunit/CRM/Contact/Form/Task/SMSCommonTest.php @@ -115,9 +115,7 @@ protected function setUp(): void { /** * Test to ensure SMS Activity QuickForm displays the right phone numbers. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testQuickFormMobileNumbersDisplay() { diff --git a/tests/phpunit/CRM/Contact/Import/Form/DataSourceTest.php b/tests/phpunit/CRM/Contact/Import/Form/DataSourceTest.php index a8ed3cc31fef..58460dd5dabb 100644 --- a/tests/phpunit/CRM/Contact/Import/Form/DataSourceTest.php +++ b/tests/phpunit/CRM/Contact/Import/Form/DataSourceTest.php @@ -52,7 +52,6 @@ public function testBuildForm(): void { * This test mimics a scenario where the form is submitted more than once * and the user_job is updated to reflect the new data source. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testDataSources(): void { @@ -122,7 +121,6 @@ public function testDataSources(): void { * @param array $sqlFormValues * * @return CRM_Contact_Import_Form_DataSource - * @throws \API_Exception * @throws \CRM_Core_Exception */ private function submitDataSourceForm(array $sqlFormValues): CRM_Contact_Import_Form_DataSource { diff --git a/tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php b/tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php index c0d8df75cb42..39dec4f75cb1 100644 --- a/tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php +++ b/tests/phpunit/CRM/Contact/Import/Form/MapFieldTest.php @@ -57,9 +57,7 @@ public function tearDown(): void { * {@see \CRM_Contact_Import_Parser_Contact::getMappingFieldFromMapperInput} * @param array $expecteds * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmit(array $params, array $mapper, array $expecteds = []): void { $form = $this->getMapFieldFormObject(array_merge($params, ['mapper' => $mapper])); @@ -140,7 +138,6 @@ public function getSubmitData(): array { * Some defaults are provided. * * @return \CRM_Contact_Import_Form_MapField - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function getMapFieldFormObject(array $submittedValues = []): CRM_Contact_Import_Form_MapField { @@ -187,7 +184,6 @@ public function getMapFieldFormObject(array $submittedValues = []): CRM_Contact_ * @param string $expectedJS * @param array $expectedDefaults * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testLoadSavedMapping(array $fieldSpec, string $expectedJS, array $expectedDefaults): void { @@ -207,9 +203,7 @@ public function testLoadSavedMapping(array $fieldSpec, string $expectedJS, array * In conjunction with testing our existing function this tests the methods we want to migrate to * to clean it up. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testLoadSavedMappingDirect(): void { $mapping = $this->storeComplexMapping(); @@ -280,7 +274,6 @@ public function mapFieldDataProvider(): array { * @param $columnHeader * @param $mapsTo * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testDefaultFromColumnNames($columnHeader, $mapsTo): void { @@ -336,7 +329,7 @@ protected function getContactSubType(): string { * * @return array * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function loadSavedMapping(int $mappingID, int $columnNumber): array { $processor = new CRM_Import_ImportProcessor(); @@ -354,7 +347,6 @@ protected function loadSavedMapping(int $mappingID, int $columnNumber): array { /** * Set up the mapping form. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ private function setUpMapFieldForm(): void { @@ -365,8 +357,7 @@ private function setUpMapFieldForm(): void { /** * Tests the routing used in the 5.50 upgrade script to stop using labels... * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testConvertFields(): void { $mapping = $this->storeComplexMapping(TRUE); diff --git a/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php b/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php index a6c7f606b800..1ba7d2ca852b 100644 --- a/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php +++ b/tests/phpunit/CRM/Contact/Import/Parser/ContactTest.php @@ -100,9 +100,7 @@ public function testImportParserWithEmployeeOfRelationship(): void { * Test that import parser will not fail when same external_identifier found * of deleted contact. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportParserWithDeletedContactExternalIdentifier(): void { $contactId = $this->individualCreate([ @@ -124,9 +122,7 @@ public function testImportParserWithDeletedContactExternalIdentifier(): void { * * In this case the contact has no external identifier. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportParserWithUpdateWithoutExternalIdentifier(): void { [$originalValues, $result] = $this->setUpBaseContact(); @@ -142,9 +138,7 @@ public function testImportParserWithUpdateWithoutExternalIdentifier(): void { * * In this case the contact has no external identifier. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportParserWithUpdateWithCustomRule(): void { $this->createCustomGroupWithFieldsOfAllTypes(); @@ -194,9 +188,7 @@ public function testImportParserWithUpdateWithCustomRule(): void { * * In this case the contact has no external identifier. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportParserWithUpdateWithCustomRuleNoExternalIDMatch(): void { $this->createCustomGroupWithFieldsOfAllTypes(); @@ -311,7 +303,7 @@ public function testImportParserUpdateWithExternalIdentifierSubtypeChangeFail(): * * The subtype is not updated, as there is conflicting contact data. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testImportParserUpdateWithExistingRelatedMatch(): void { $contactID = $this->individualCreate([ @@ -449,9 +441,7 @@ public function testImportParserWithUpdateWithChangedExternalIdentifier(): void /** * Test that the import parser adds the address to the right location. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportBillingAddress(): void { [$contactValues] = $this->setUpBaseContact(); @@ -739,9 +729,7 @@ public function testGenderLabel(): void { /** * Test greeting imports. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGreetings(): void { $contactValues = [ @@ -787,9 +775,7 @@ public function testGreetings(): void { * * There is an expectation that you can import by label here. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPrefixLabel(): void { $this->callAPISuccess('OptionValue', 'create', ['option_group_id' => 'individual_prefix', 'name' => 'new_one', 'label' => 'special', 'value' => 70]); @@ -824,9 +810,7 @@ public function testPrefixLabel(): void { /** * Test that labels work for importing custom data. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCustomDataLabel(): void { $this->createCustomGroupWithFieldOfType([], 'select'); @@ -939,9 +923,7 @@ public function testImportTwoAddressFirstPrimary(): void { /** * Test importing 2 phones of different types. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportTwoPhonesDifferentTypes(): void { $processor = new CRM_Import_ImportProcessor(); @@ -1127,7 +1109,6 @@ public function validateDataProvider(): array { * * @dataProvider importDataProvider * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \League\Csv\CannotInsertRecord */ @@ -1157,7 +1138,6 @@ public function testImport($csv, $mapper, $expectedOutcomes = [], $submittedValu } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testImportContactToGroup(): void { @@ -1229,7 +1209,6 @@ public function importDataProvider(): array { * * If it's not gonna import it should fail at the validation stage... * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testImportGenders(): void { @@ -1258,7 +1237,6 @@ public function testImportGenders(): void { /** * Test importing state country & county. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testImportCountryStateCounty(): void { @@ -1327,7 +1305,6 @@ public function testImportCountryStateCounty(): void { * @param string $csv * @param int $dateType * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testValidateDateData(string $csv, int $dateType): void { @@ -1369,7 +1346,7 @@ public function testValidateDateData(string $csv, int $dateType): void { } /** - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testImportContactSubTypes(): void { ContactType::create()->setValues([ @@ -1421,7 +1398,7 @@ public function dateDataProvider(): array { /** * Test location importing, including for related contacts. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testImportLocations(): void { $csv = 'individual_locations_with_related.csv'; @@ -1680,9 +1657,7 @@ public function testImportAmbiguousStateCountry(): void { * Ensure we can import multiple preferred_communication_methods, single * gender, and single preferred language using both labels and values. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportFieldsWithVariousOptions(): void { $processor = new CRM_Import_ImportProcessor(); @@ -1779,7 +1754,7 @@ protected function runImport(array $originalValues, int $onDuplicateAction, int * @param array $submittedValues * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getDataSourceAndParser(string $csv, array $mapper, array $submittedValues): array { @@ -1803,7 +1778,7 @@ protected function getDataSourceAndParser(string $csv, array $mapper, array $sub /** * @param int $contactID * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function addChild(int $contactID): void { $relatedContactID = $this->individualCreate(); @@ -1824,7 +1799,7 @@ protected function addChild(int $contactID): void { /** * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function getRelationships(): array { @@ -1912,7 +1887,7 @@ protected function getFieldMappingFromInput(array $contactValues, $defaultLocati /** * Test mapping fields within the Parser class. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMapFields(): void { @@ -1979,9 +1954,7 @@ public function testMapFields(): void { * * https://github.com/civicrm/civicrm-core/blob/ca13ec46eae2042604e4e106c6cb3dc0439db3e2/CRM/Dedupe/Finder.php#L238 * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testImportParserDoesNotMatchPrimaryToRelated(): void { @@ -2039,7 +2012,7 @@ protected function setUpBaseContact(array $params = []): array { /** * @return mixed - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getUserJobID($submittedValues = []) { @@ -2073,7 +2046,6 @@ protected function getUserJobID($submittedValues = []) { /** * Test geocode validation. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testImportGeocodes(): void { @@ -2097,7 +2069,7 @@ public function testImportGeocodes(): void { * @param array $submittedValues * Any submitted values overrides. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function validateCSV(string $csv, array $mapper, array $submittedValues = []): void { [$dataSource, $parser] = $this->getDataSourceAndParser($csv, $mapper, $submittedValues); @@ -2200,7 +2172,7 @@ private function validateMultiRowCsv(string $csv, array $mapper, string $field, * Get the contacts we imported (Susie Jones & family). * * @return array - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function getImportedContacts(): array { return (array) Contact::get() @@ -2226,9 +2198,7 @@ public function getImportedContacts(): array { * * @dataProvider getBooleanDataProvider * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testImportParserWithExternalIdForRelationship(bool $isOrganizationProvided): void { $contactImportValues = [ @@ -2263,7 +2233,6 @@ public function testImportParserWithExternalIdForRelationship(bool $isOrganizati * @param array $values * @param string $expected * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function importValues($userJobID, array $values, string $expected): void { diff --git a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php index 91e467eac767..26836b698392 100644 --- a/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php +++ b/tests/phpunit/CRM/Contact/Page/View/UserDashBoardTest.php @@ -137,7 +137,7 @@ public function testDashboardContentContributionsWithInvoicingEnabled(): void { /** * Test the content of the dashboard. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testDashboardContentContributions(): void { $this->contributionCreate(['contact_id' => $this->contactID]); @@ -160,7 +160,6 @@ public function testDashboardContentContributions(): void { * Test the presence of a "Pay Now" button on partial payments * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDashboardPartialPayments(): void { $contributionId = $this->contributionCreate([ diff --git a/tests/phpunit/CRM/Contribute/ActionMapping/ByTypeTest.php b/tests/phpunit/CRM/Contribute/ActionMapping/ByTypeTest.php index 24fffc1d4897..b208a92e7143 100644 --- a/tests/phpunit/CRM/Contribute/ActionMapping/ByTypeTest.php +++ b/tests/phpunit/CRM/Contribute/ActionMapping/ByTypeTest.php @@ -282,8 +282,7 @@ public function useHelloFirstNameStatus(): void { * legacy processor function. Once this is true we can expose the listener on the * token processor for contribution and call it internally from the legacy code. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testTokenRendering(): void { $this->targetDate = '20150201000107'; diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php index 7cf2a42f8948..a4d9ba52ba51 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionRecurTest.php @@ -26,7 +26,7 @@ class CRM_Contribute_BAO_ContributionRecurTest extends CiviUnitTestCase { /** * Set up for test. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); @@ -139,9 +139,7 @@ public function testUpdateRecur(): void { /** * Check test contributions aren't picked up as template for non-test recurs * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testGetTemplateContributionMatchTest1(): void { @@ -176,9 +174,7 @@ public function testGetTemplateContributionMatchTest1(): void { /** * Check non-test contributions aren't picked up as template for test recurs * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testGetTemplateContributionMatchTest(): void { @@ -224,9 +220,7 @@ public function testGetTemplateContributionMatchTest(): void { * Then we delete the template contribution and make sure a new one exists. * At that time the second contribution should be used a template as that is the most recent one (according to the date). * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testCreateTemplateContributionFromFirstContributionTest(): void { @@ -324,8 +318,7 @@ public function implementHookPost($op, $objectName, $objectId, &$objectRef) { /** * Test that is_template contribution is used where available * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testGetTemplateContributionNewTemplate(): void { @@ -370,8 +363,7 @@ public function testGetTemplateContributionNewTemplate(): void { /** * Test that is_template contribution is used where available * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testTemplateContributionUpdatesRecur(): void { @@ -426,7 +418,7 @@ public function testTemplateContributionUpdatesRecur(): void { /** * Test to check if correct membership is auto renewed. * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testAutoRenewalWhenOneMemberIsDeceased(): void { $contactId1 = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index 3cdf3789c330..ec157a43f56e 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -672,7 +672,6 @@ public function checkItemValues($contribution) { * assignProportionalLineItems() method (add and edit modes of participant) * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAssignProportionalLineItems(): void { // This test doesn't seem to manage financials properly, possibly by design @@ -699,7 +698,6 @@ public function testAssignProportionalLineItems(): void { * @return CRM_Contribute_BAO_Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function addParticipantWithContribution() { // creating price set, price field @@ -1024,7 +1022,6 @@ public function testCreateProportionalEntry($thousandSeparator) { * punctuation used to refer to thousands. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider getThousandSeparators */ public function testCreateProportionalEntryZeroAmount(string $thousandSeparator): void { @@ -1241,7 +1238,7 @@ public function testProcessOnBehalfOrganization() { * This function tests whether the contribution tokens are replaced with * values from contribution. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testReplaceContributionTokens(): void { $customGroup = $this->customGroupCreate(['extends' => 'Contribution', 'title' => 'contribution stuff']); @@ -1503,9 +1500,7 @@ public function testSendMailUpdateReceiptDate() { * The pledge status should be updated. I believe the contribution should * also be unlinked but the goal at this point is no change. * - * @throws CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testCancelOrderWithPledge(): void { $this->ids['contact'][0] = $this->individualCreate(); @@ -1528,9 +1523,7 @@ public function testCancelOrderWithPledge(): void { * Test contribution update when more than one quick * config line item is linked to contribution. * - * @throws CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testContributionQuickConfigTwoLineItems(): void { $contactId1 = $this->individualCreate(); @@ -1738,7 +1731,7 @@ public function testUpdateActivityContactOnContributionContactChange(): void { /** * Test status updates triggering activity creation and value propagation * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testContributionStatusUpdateActivityPropagation() { diff --git a/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php b/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php index 8af6aee0d055..54c6e6950785 100644 --- a/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Contribute/Form/AdditionalPaymentTest.php @@ -72,7 +72,7 @@ class CRM_Contribute_Form_AdditionalPaymentTest extends CiviUnitTestCase { /** * Setup function. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); @@ -119,7 +119,6 @@ public function tearDown(): void { * Test the submit function that completes the partially paid Contribution using Credit Card. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAddPaymentUsingCreditCardForPartiallyPaidContribution(): void { $mut = new CiviMailUtils($this, TRUE); @@ -147,7 +146,6 @@ public function testAddPaymentUsingCreditCardForPartiallyPaidContribution(): voi * Test the submit function that completes the partially paid Contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAddPaymentForPartiallyPaidContribution(): void { $this->createPartiallyPaidOrder(); @@ -161,7 +159,6 @@ public function testAddPaymentForPartiallyPaidContribution(): void { * Test the submit function that completes the partially paid Contribution with multiple payments. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMultiplePaymentForPartiallyPaidContribution(): void { $this->createPartiallyPaidOrder(); @@ -193,7 +190,6 @@ public function testMultiplePaymentForPartiallyPaidContribution(): void { * Test the submit function that completes the partially paid Contribution with multiple payments. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMultiplePaymentForPartiallyPaidContributionWithOneCreditCardPayment(): void { $mut = new CiviMailUtils($this, TRUE); @@ -237,7 +233,6 @@ public function testMultiplePaymentForPartiallyPaidContributionWithOneCreditCard * Test the submit function that completes the pending pay later Contribution using Credit Card. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAddPaymentUsingCreditCardForPendingPayLaterContribution(): void { $mut = new CiviMailUtils($this, TRUE); @@ -266,7 +261,6 @@ public function testAddPaymentUsingCreditCardForPendingPayLaterContribution(): v * Test the submit function that completes the pending pay later Contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAddPaymentForPendingPayLaterContribution(): void { $this->createPendingOrder(); @@ -288,7 +282,6 @@ public function testAddPaymentForPendingPayLaterContribution(): void { * Test the Membership status after completing the pending pay later Contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipStatusAfterCompletingPayLaterContribution(): void { $this->createContributionAndMembershipOrder(); @@ -301,7 +294,6 @@ public function testMembershipStatusAfterCompletingPayLaterContribution(): void * Test the submit function that completes the pending pay later Contribution with multiple payments. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMultiplePaymentForPendingPayLaterContribution(): void { $this->createPendingOrder(); @@ -327,7 +319,6 @@ public function testMultiplePaymentForPendingPayLaterContribution(): void { * Test the submit function that completes the pending pay later Contribution with multiple payments. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMultiplePaymentForPendingPayLaterContributionWithOneCreditCardPayment(): void { $this->createPendingOrder(); @@ -358,7 +349,6 @@ public function testMultiplePaymentForPendingPayLaterContributionWithOneCreditCa * Mode of Payment * @param bool $isEmailReceipt * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function submitPayment(float $amount, string $mode = NULL, bool $isEmailReceipt = FALSE): void { @@ -458,7 +448,6 @@ protected function createPartiallyPaidOrder(): void { * Test the Membership status renaming after completing the pending pay later Contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipStatusAfterCompletingPayLaterContributionWithRenamedMembershipStatus(): void { $this->renameNewMembershipStatus('Fresh'); diff --git a/tests/phpunit/CRM/Contribute/Form/CancelSubscriptionTest.php b/tests/phpunit/CRM/Contribute/Form/CancelSubscriptionTest.php index 5456f0245acd..a711fcfc876d 100644 --- a/tests/phpunit/CRM/Contribute/Form/CancelSubscriptionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/CancelSubscriptionTest.php @@ -19,7 +19,7 @@ class CRM_Contribute_Form_CancelSubscriptionTest extends CiviUnitTestCase { /** * Test the mail sent on update. * - * @throws \CRM_Core_Exception|\API_Exception + * @throws \CRM_Core_Exception */ public function testMail(): void { $mut = new CiviMailUtils($this, TRUE); @@ -61,7 +61,6 @@ public function getExpectedMailStrings(): array { * Recurring Contribution * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCancelSubscriptionForm(): void { $this->addContribution(); diff --git a/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php b/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php index 375480452024..d6c4b91e3624 100644 --- a/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Contribution/ConfirmTest.php @@ -32,7 +32,6 @@ public function tearDown(): void { * CRM-21200: Test that making online payment for pending contribution * doesn't overwrite the contribution details * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testPayNowPayment(): void { diff --git a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php index 77a7181a4f15..eb3f8a2580e9 100644 --- a/tests/phpunit/CRM/Contribute/Form/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/ContributionTest.php @@ -76,7 +76,7 @@ class CRM_Contribute_Form_ContributionTest extends CiviUnitTestCase { /** * Setup function. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { $this->_apiversion = 3; @@ -182,7 +182,6 @@ public function testSubmitCreditCard(): void { * Test the submit function on the contribution page. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitCreditCardPayPal(): void { $mut = new CiviMailUtils($this, TRUE); @@ -480,7 +479,6 @@ public function testSubmitCreditCardFullyDeductible(): void { * - 1 civicrm_financial_item. This is linked to the line item and has a status of 3 * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitCreditCardInvalid(): void { $form = new CRM_Contribute_Form_Contribution(); @@ -521,7 +519,6 @@ public function testSubmitCreditCardInvalid(): void { * Test the submit function creates a billing address if provided. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitCreditCardWithBillingAddress(): void { $this->submitContributionForm([ @@ -642,7 +639,6 @@ public function testSubmitEmailReceiptUserEmailFromAddress(): void { * * @param bool $isTaxed * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -1033,7 +1029,6 @@ protected function getCreditCardParams(): array { * Test the submit function that completes the partially paid payment using Credit Card * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPartialPaymentWithCreditCard(): void { // create a partially paid contribution by using back-office form @@ -1472,7 +1467,6 @@ public function testCardTypeAndPanTruncationLiveMode(): void { * updating multiple memberships * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testCustomFieldsOnMembershipGetUpdated(): void { diff --git a/tests/phpunit/CRM/Contribute/Form/Task/EmailTest.php b/tests/phpunit/CRM/Contribute/Form/Task/EmailTest.php index 8211eae5a628..d327cbfc5831 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/EmailTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/EmailTest.php @@ -22,7 +22,6 @@ class CRM_Contribute_Form_Task_EmailTest extends CiviUnitTestCase { * Clean up after each test. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function tearDown(): void { $this->quickCleanUpFinancialEntities(); diff --git a/tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php b/tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php index 036ca5be90f1..456be2e722f6 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/PDFLetterCommonTest.php @@ -47,7 +47,6 @@ protected function setUp(): void { /** * Clean up after each test. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function tearDown(): void { @@ -61,7 +60,6 @@ public function tearDown(): void { * Test thank you send with grouping. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGroupedThankYous(): void { $this->ids['Contact'][0] = $this->individualCreate(); @@ -115,7 +113,7 @@ public function testGroupedThankYous(): void { /** * Test the buildContributionArray function. * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testBuildContributionArray(): void { $this->_individualId = $this->individualCreate(); @@ -193,7 +191,6 @@ public function hookTokenValues(&$details, $contactIDs, $jobID, $tokens, $classN * Test contribution token replacement in * html returned by postProcess function. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testPostProcess(): void { @@ -240,7 +237,6 @@ public function testPostProcess(): void { * Test that no notice or errors occur if no contribution tokens are requested. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testNoContributionTokens(): void { $this->createLoggedInUser(); @@ -264,7 +260,6 @@ public function testNoContributionTokens(): void { * Test all contribution tokens. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAllContributionTokens(): void { $this->hookClass->setHook('civicrm_tokenValues', [$this, 'hookTokenValues']); @@ -386,7 +381,6 @@ public function getAllContributionTokens(): array { * arrays reflect the most recent contact rather than a total aggregate, * since we are using group by. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testPostProcessGroupByContact(): void { diff --git a/tests/phpunit/CRM/Contribute/Form/Task/PDFTest.php b/tests/phpunit/CRM/Contribute/Form/Task/PDFTest.php index e265d0bc65ef..4d96bb997566 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/PDFTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/PDFTest.php @@ -32,7 +32,7 @@ protected function tearDown(): void { * Test the send pdf task filters out contacts who should not receive the * receipt. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testSendPDF(): void { $variants = [[], ['do_not_email' => TRUE], ['email' => ''], ['is_deceased' => TRUE], ['on_hold' => 1]]; diff --git a/tests/phpunit/CRM/Contribute/Form/Task/StatusTest.php b/tests/phpunit/CRM/Contribute/Form/Task/StatusTest.php index 15fe9d3dd9b1..02b91f99955f 100644 --- a/tests/phpunit/CRM/Contribute/Form/Task/StatusTest.php +++ b/tests/phpunit/CRM/Contribute/Form/Task/StatusTest.php @@ -28,7 +28,6 @@ public function tearDown(): void { /** * Test update pending contribution with sending a confirmation mail. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception * @throws \Exception */ diff --git a/tests/phpunit/CRM/Contribute/Form/TaskTest.php b/tests/phpunit/CRM/Contribute/Form/TaskTest.php index cc8c0e94e327..59e3f0efc702 100644 --- a/tests/phpunit/CRM/Contribute/Form/TaskTest.php +++ b/tests/phpunit/CRM/Contribute/Form/TaskTest.php @@ -31,7 +31,6 @@ public function tearDown(): void { * executes without any error after sorting the search result. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPreProcessCommonAfterSorting(): void { $fields = [ diff --git a/tests/phpunit/CRM/Contribute/Form/UpdateSubscriptionTest.php b/tests/phpunit/CRM/Contribute/Form/UpdateSubscriptionTest.php index 4dc9aae6a4cd..2199e7597513 100644 --- a/tests/phpunit/CRM/Contribute/Form/UpdateSubscriptionTest.php +++ b/tests/phpunit/CRM/Contribute/Form/UpdateSubscriptionTest.php @@ -19,7 +19,7 @@ class CRM_Contribute_Form_UpdateSubscriptionTest extends CiviUnitTestCase { /** * Test the mail sent on update. * - * @throws \CRM_Core_Exception|\API_Exception + * @throws \CRM_Core_Exception */ public function testMail(): void { $mut = new CiviMailUtils($this, TRUE); diff --git a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php index 569cf86086e5..402ff2a54d5f 100644 --- a/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php @@ -34,7 +34,7 @@ class CRM_Contribute_Import_Parser_ContributionTest extends CiviUnitTestCase { /** * Cleanup function. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function tearDown(): void { $this->quickCleanUpFinancialEntities(); @@ -198,7 +198,7 @@ public function testContributionStatusLabel(): void { * These features are * - default_value for each field. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testImportFromUserJobConfiguration(): void { $importMappings = [ @@ -297,7 +297,7 @@ public function testPledgeImport(): void { /** * Test phone is included if it is part of dedupe rule. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testPhoneMatchOnContact(): void { // Update existing unsupervised rule, change to general. @@ -614,7 +614,6 @@ protected function runImport(array $originalValues, int $onDuplicateAction, ?int * * @return int * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getUserJobID(array $submittedValues = []): int { diff --git a/tests/phpunit/CRM/Contribute/Page/TabTest.php b/tests/phpunit/CRM/Contribute/Page/TabTest.php index a32f323c43ab..d2a86a1bd443 100644 --- a/tests/phpunit/CRM/Contribute/Page/TabTest.php +++ b/tests/phpunit/CRM/Contribute/Page/TabTest.php @@ -31,8 +31,7 @@ public function tearDown(): void { /** * Test links render correctly for manual processor. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testLinksManual(): void { [$contactID, $recurID] = $this->setupTemplate(); @@ -47,8 +46,7 @@ public function testLinksManual(): void { /** * Test links render correctly for manual processor. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testLinksPaypalStandard(): void { $this->setupTemplate([ @@ -77,8 +75,7 @@ public function testLinksPaypalStandard(): void { * @param array $recurParams * * @return array - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function setupTemplate($recurParams = []): array { diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 5c45f8f17680..83a9d47ccc6f 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -851,8 +851,6 @@ public function setUp(): void { * This method is called after a test is executed. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function tearDown(): void { $this->deleteTestObjects(); @@ -875,7 +873,7 @@ public function tearDown(): void { * * It should exist but this class over-deletes in not-fully-diagnosed places. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getMembershipTypeID(): int { $generalTypeID = CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'membership_type_id', 'General'); @@ -1033,7 +1031,6 @@ public function mailerExamples(): array { * Ex: array('subject' => '/^Hello, Alice!/'). * Keys: subject, body_text, body_html, from_name, from_email. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @dataProvider mailerExamples @@ -1126,7 +1123,6 @@ public function testReminderWithCustomDateField(): void { /** * Test calculated activity schedule. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testActivityDateTimeMatchNonRepeatableSchedule(): void { @@ -1175,7 +1171,6 @@ public function testActivityDateTimeMatchNonRepeatableSchedule(): void { /** * Test "minute" as a valid unit. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testActivityDateTimeMinuteUnit(): void { @@ -1327,9 +1322,7 @@ public function testEventNameWithAbsoluteDateAndNothingElse(): void { * For contacts/members which match schedule based on join/start date, * an email should be sent. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipDateMatch(): void { $contactID = $this->individualCreate(array_merge($this->fixtures['contact'], ['email' => 'test-member@example.com'])); @@ -1376,7 +1369,6 @@ public function testMembershipDateMatch(): void { * CRM-21675: Support parent and smart group in 'Limit to' field * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testScheduleReminderWithParentGroup(): void { // Contact A with birth-date at '07-07-2005' and gender - Male, later got added in smart group @@ -1467,9 +1459,7 @@ public function testScheduleReminderWithParentGroup(): void { * For contacts/members which match schedule based on join date, * an email should be sent. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipJoinDateNonMatch(): void { $this->createMembershipFromFixture('rolling_membership', '', ['email' => 'test-member@example.com']); @@ -1490,9 +1480,7 @@ public function testMembershipJoinDateNonMatch(): void { /** * Test that the first and SECOND notifications are sent out. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipEndDateRepeat(): void { // creates membership with end_date = 20120615 @@ -1555,9 +1543,7 @@ public function testMembershipEndDateRepeat(): void { * between * see CRM-15376 * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipEndDateRepeatChangedEndDate_CRM_15376(): void { // creates membership with end_date = 20120615 @@ -1595,9 +1581,7 @@ public function testMembershipEndDateRepeatChangedEndDate_CRM_15376(): void { * For contacts/members which match schedule based on end date, * an email should be sent. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipEndDateMatch(): void { // creates membership with end_date = 20120615 @@ -1698,9 +1682,7 @@ public function testMembershipEndDateMatch(): void { * reminder for the first contact returned in a query for renewed * memberships. Other contacts wouldn't get the mail. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMultipleMembershipEndDateMatch(): void { $contactID = $this->callAPISuccess('Contact', 'create', array_merge($this->fixtures['contact'], ['email' => 'test-member@example.com']))['id']; @@ -1774,9 +1756,7 @@ public function testMultipleMembershipEndDateMatch(): void { * For contacts/members which match schedule based on end date, * an email should be sent. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipEndDateNoMatch(): void { // creates membership with end_date = 20120615 @@ -1935,9 +1915,7 @@ public function testContactModifiedAnniversary(): void { * Check that limit_to + an empty recipients doesn't sent to multiple * contacts. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipLimitToNone(): void { // creates membership with end_date = 20120615 @@ -1966,9 +1944,7 @@ public function testMembershipLimitToNone(): void { /** * Test handling of reference date for memberships. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipWithReferenceDate(): void { $membership = $this->createMembershipFromFixture('rolling_membership', 'Current', ['email' => 'member@example.com']); @@ -2026,9 +2002,7 @@ public function testMembershipWithReferenceDate(): void { /** * Test multiple membership reminder. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipOnMultipleReminder(): void { $membership = $this->createMembershipFromFixture('rolling_membership', 'Current', ['email' => 'member@example.com']); @@ -2155,7 +2129,6 @@ public function testMembershipOnMultipleReminder(): void { /** * Test reminders sent on custom data anniversary. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testContactCustomDate_Anniversary(): void { @@ -2185,7 +2158,6 @@ public function testContactCustomDate_Anniversary(): void { * Test sched reminder set via registration date. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testEventTypeRegistrationDate(): void { $contact = $this->individualCreate(['email' => 'test-event@example.com']); @@ -2257,7 +2229,6 @@ public function testEventTypeRegistrationDate(): void { * Test sched reminder set via start date. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testEventTypeStartDate(): void { // Create event+participant with start_date = 20120315, end_date = 20120615. @@ -2735,9 +2706,7 @@ public function createModifiedDateTime(DateTime $origDateTime, string $modifyRul /** * Test absolute date handling for membership. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMembershipScheduleWithAbsoluteDate(): void { @@ -2781,9 +2750,7 @@ public function testMembershipScheduleWithAbsoluteDate(): void { * @param array $membershipOverrides * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function createMembershipFromFixture(string $fixture, string $status, array $emailParams = [], array $membershipOverrides = []): array { diff --git a/tests/phpunit/CRM/Core/BAO/AddressTest.php b/tests/phpunit/CRM/Core/BAO/AddressTest.php index e662c2f197c3..371440559e14 100644 --- a/tests/phpunit/CRM/Core/BAO/AddressTest.php +++ b/tests/phpunit/CRM/Core/BAO/AddressTest.php @@ -425,7 +425,6 @@ public function setStreetAddressParsing($status) { * ParseStreetAddress if enabled, otherwise, don't. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testParseStreetAddressIfEnabled() { // Turn off address standardization. Parsing should work without it. diff --git a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php index 23968d527a86..9316bf0acf1a 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomFieldTest.php @@ -425,7 +425,7 @@ public function testMoveField() { /** * Test get custom field id function. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testGetCustomFieldID() { $this->createCustomField(); diff --git a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php index a575281adfd4..7b28c94dbd2c 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomGroupTest.php @@ -20,9 +20,7 @@ class CRM_Core_BAO_CustomGroupTest extends CiviUnitTestCase { /** * Clean up after test. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $this->quickCleanup(['civicrm_contact'], TRUE); @@ -446,7 +444,7 @@ public function testCheckCustomField() { /** * Test getActiveGroups() with Invalid Params() * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testGetActiveGroupsWithInvalidParams(): void { $contactId = $this->individualCreate(); @@ -517,7 +515,6 @@ public function testCreate(): void { * Test create() given a table_name * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function testCreateTableName(): void { $params = [ diff --git a/tests/phpunit/CRM/Core/BAO/CustomQueryTest.php b/tests/phpunit/CRM/Core/BAO/CustomQueryTest.php index 6888defc0407..c7a0ef4df47a 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomQueryTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomQueryTest.php @@ -96,7 +96,6 @@ public function testSearchCustomDataDateRelative() { * The conversion to date picker will result int these fields * being renamed _high & _low and needing to return correctly. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -130,7 +129,6 @@ public function testSearchCustomDataDateHighLow() { * The conversion to date picker will result int these fields * being renamed _high & _low and needing to return correctly. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -486,7 +484,6 @@ public function testSearchCustomDataDateEquals() { /** * Test search builder style query including custom address fields. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php index ace9d63b4280..58363e42ca01 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableSetGetTest.php @@ -9,7 +9,7 @@ class CRM_Core_BAO_CustomValueTableSetGetTest extends CiviUnitTestCase { /** * Test setValues() and GetValues() methods with custom Date field * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSetGetValuesDate(): void { $contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php index 61b74ad1b974..7961daca8ccc 100644 --- a/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php +++ b/tests/phpunit/CRM/Core/BAO/CustomValueTableTest.php @@ -167,7 +167,7 @@ public function testStoreRichTextEditor(): void { /** * Test store function for multiselect int. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testStoreMultiSelectInt(): void { $contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php b/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php index b8d657498de5..a7f51081782f 100644 --- a/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php +++ b/tests/phpunit/CRM/Core/BAO/MessageTemplateTest.php @@ -98,7 +98,7 @@ public function getLocaleConfigurations(): array { * even if the system doesn't allow it in the web UI. Ex: The sysadmin has configured 'fr_FR' * strings. The user has requested 'fr_CA', and we'll fallback to 'fr_CA'. * - * @throws \API_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception * @group locale * @dataProvider getLocaleConfigurations */ @@ -168,7 +168,6 @@ public function testRenderTranslatedTemplate($settings, $templates, $preferredLa } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testSendTemplate_RenderMode_OpenTemplate(): void { @@ -279,9 +278,7 @@ public function testSendTemplateRenderModeTokenContext(): void { /** * Test message template send. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCaseActivityCopyTemplate():void { $client_id = $this->individualCreate(); @@ -326,7 +323,6 @@ public function testCaseActivityCopyTemplate():void { * Test rendering of domain tokens. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function testDomainTokens(): void { $values = $this->getDomainTokenData(); @@ -402,9 +398,7 @@ public function testRenderTemplateIgnoreSmarty(): void { /** * Test rendering of contact tokens. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactTokens(): void { // Freeze the time at the start of the test, so checksums don't suffer from second rollovers. @@ -515,7 +509,6 @@ public function hookTokenValues(array &$details): void { /** * Test that unresolved tokens are not causing a fatal error in smarty. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testUnresolvedTokens(): void { @@ -542,9 +535,7 @@ public function hookTokens(array &$hookTokens): void { * function uses the token processor - at that point the test above * will be testing the same thing. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactTokensRenderedByTokenProcessor(): void { $this->createCustomGroupWithFieldsOfAllTypes([]); @@ -706,9 +697,7 @@ public function getAdvertisedTokens(): array { * Note it will render additional custom fields if they exist. * * @return array - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function getOldContactTokens(): array { return [ @@ -848,7 +837,7 @@ protected function setupContactFromTokeData(array $tokenData) { * @param string $actualOutput * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getExpectedContactOutput($id, array $tokenData, string $actualOutput): string { $checksum = substr($actualOutput, (strpos($actualOutput, 'cs=') + 3), 47); @@ -949,7 +938,7 @@ protected function getExpectedContactOutput($id, array $tokenData, string $actua * @param string $actualOutput * * @return string - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function getExpectedContactOutputNewStyle($id, array $tokenData, string $actualOutput): string { $checksum = substr($actualOutput, (strpos($actualOutput, 'cs=') + 3), 47); diff --git a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php index f113a40decf7..121edf139efd 100644 --- a/tests/phpunit/CRM/Core/InnoDBIndexerTest.php +++ b/tests/phpunit/CRM/Core/InnoDBIndexerTest.php @@ -14,9 +14,7 @@ class CRM_Core_InnoDBIndexerTest extends CiviUnitTestCase { protected $indices = []; /** - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $idx = new CRM_Core_InnoDBIndexer(FALSE, []); diff --git a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php index 6ae28ea9c297..a05526f2ba99 100644 --- a/tests/phpunit/CRM/Core/ManagedEntitiesTest.php +++ b/tests/phpunit/CRM/Core/ManagedEntitiesTest.php @@ -155,7 +155,7 @@ public function hookManaged(array &$entities): void { * @param string $moduleName * @param string $managedName * @return array|null - * @throws CiviCRM_API3_Exception + * @throws CRM_Core_Exception */ private function getManagedEntity(string $moduleName, string $managedName):? array { $dao = new CRM_Core_DAO_Managed(); diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php index a3a63e583906..e280ff6cf4f9 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetIPNTest.php @@ -48,9 +48,7 @@ public function tearDown(): void { * Ensure recurring contributions from Contribution Pages * with receipt turned off don't send a receipt. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentRecurNoReceipt(): void { $mut = new CiviMailUtils($this, TRUE); @@ -149,9 +147,7 @@ public function testIPNPaymentRecurNoReceipt(): void { /** * Test IPN response updates contribution_recur & contribution for first & second contribution * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentRecurSuccess(): void { CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign'); @@ -182,9 +178,7 @@ public function testIPNPaymentRecurSuccess(): void { /** * Test payment processor is correctly assigned for the IPN payment. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentRecurSuccessMultiAuthNetProcessor(): void { //Create and set up recur payment using second instance of AuthNet Processor. @@ -206,9 +200,7 @@ public function testIPNPaymentRecurSuccessMultiAuthNetProcessor(): void { /** * Test IPN response updates contribution_recur & contribution for first & second contribution * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentRecurSuccessSuppliedReceiveDate(): void { $this->setupRecurringPaymentProcessorTransaction(); @@ -236,9 +228,7 @@ public function testIPNPaymentRecurSuccessSuppliedReceiveDate(): void { * Test IPN response updates contribution_recur & contribution for first & * second contribution * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentMembershipRecurSuccess(): void { $this->createRepeatMembershipOrder(); @@ -275,9 +265,7 @@ public function testIPNPaymentMembershipRecurSuccess(): void { /** * Test IPN response mails don't leak. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentMembershipRecurSuccessNoLeakage(): void { $mut = new CiviMailUtils($this, TRUE); @@ -350,9 +338,7 @@ public function testIPNPaymentMembershipRecurSuccessNoLeakage(): void { /** * Test IPN response mails don't leak. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testIPNPaymentMembershipRecurSuccessNoLeakageOnlineThenOffline(): void { $mut = new CiviMailUtils($this, TRUE); diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php index 2a38e9dab3e3..8816f4f09821 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php @@ -40,7 +40,7 @@ public function tearDown(): void { * Test doing a one-off payment. * * @throws \Civi\Payment\Exception\PaymentProcessorException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSinglePayment() { $this->setupMockHandler(); diff --git a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php index 38871fa041a5..8c298981916c 100644 --- a/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php +++ b/tests/phpunit/CRM/Core/Payment/AuthorizeNetTrait.php @@ -51,7 +51,7 @@ public function getExpectedSinglePaymentRequest() { * * @param int|null $id * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setupMockHandler($id = NULL) { if ($id) { @@ -75,7 +75,7 @@ public function getExpectedRecurResponse() { /** * Create an AuthorizeNet processors with a configured mock handler. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function createAuthorizeNetProcessor() { $processorID = $this->paymentProcessorAuthorizeNetCreate(['is_test' => FALSE]); diff --git a/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php index 8a9ebb6920cd..4cec5e265118 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php @@ -115,9 +115,7 @@ public function testInvoiceSentOnIPNPaymentSuccess(): void { * The scenario is that a pending contribution exists and the first call will * update it to completed. The second will create a new contribution. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testIPNPaymentRecurSuccess(): void { @@ -167,8 +165,6 @@ public function testIPNPaymentRecurSuccess(): void { * second contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function testIPNPaymentMembershipRecurSuccess(): void { $durationUnit = 'year'; diff --git a/tests/phpunit/CRM/Core/Payment/PaypalProTest.php b/tests/phpunit/CRM/Core/Payment/PaypalProTest.php index 94e3196ff533..fd3444956827 100644 --- a/tests/phpunit/CRM/Core/Payment/PaypalProTest.php +++ b/tests/phpunit/CRM/Core/Payment/PaypalProTest.php @@ -18,7 +18,7 @@ class CRM_Core_Payment_PaypalProTest extends CiviUnitTestCase { use CRM_Core_Payment_PaypalProTrait; /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); @@ -36,7 +36,7 @@ public function tearDown(): void { * Test doing a one-off payment. * * @throws \Civi\Payment\Exception\PaymentProcessorException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testSinglePayment() { $this->setupMockHandler(); diff --git a/tests/phpunit/CRM/Core/Payment/PaypalProTrait.php b/tests/phpunit/CRM/Core/Payment/PaypalProTrait.php index 126e2e7d3709..02371f27e329 100644 --- a/tests/phpunit/CRM/Core/Payment/PaypalProTrait.php +++ b/tests/phpunit/CRM/Core/Payment/PaypalProTrait.php @@ -70,7 +70,7 @@ public function getExpectedRecurResponses() { * * @param int|null $id * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setupMockHandler($id = NULL) { if ($id) { @@ -87,7 +87,7 @@ protected function setupMockHandler($id = NULL) { /** * Create an AuthorizeNet processors with a configured mock handler. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function createPaypalProProcessor() { $processorID = $this->paymentProcessorCreate(['is_test' => 0]); diff --git a/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php b/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php index 1f2689bace2a..214e815a180f 100644 --- a/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php +++ b/tests/phpunit/CRM/Core/Payment/PaypalStdTest.php @@ -21,7 +21,7 @@ class CRM_Core_Payment_PaypalStdTest extends CiviUnitTestCase { protected $processor; /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); diff --git a/tests/phpunit/CRM/Dedupe/MergerTest.php b/tests/phpunit/CRM/Dedupe/MergerTest.php index a93a914e9da5..fe9bcd080a62 100644 --- a/tests/phpunit/CRM/Dedupe/MergerTest.php +++ b/tests/phpunit/CRM/Dedupe/MergerTest.php @@ -159,9 +159,7 @@ public function deleteDupeContacts(): void { /** * Test the batch merge. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeSelectedDuplicates(): void { $this->createDupeContacts(); @@ -318,7 +316,6 @@ public function testGetCidRefs(): void { * focus is on ensuring they match. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatches(): void { $this->setupMatchData(); @@ -379,7 +376,6 @@ public function testGetMatchesExcludeDeleted(bool $isReverse): void { * Test that location type is ignored when deduping by postal address. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesIgnoreLocationType(): void { $contact1 = $this->individualCreate(); @@ -411,7 +407,6 @@ public function testGetMatchesIgnoreLocationType(): void { * Test results are returned when criteria are passed in. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesCriteriaMatched(): void { $this->setupMatchData(); @@ -426,7 +421,6 @@ public function testGetMatchesCriteriaMatched(): void { * Test results are returned when criteria are passed in & limit is respected. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesCriteriaMatchedWithLimit(): void { $this->setupMatchData(); @@ -443,7 +437,6 @@ public function testGetMatchesCriteriaMatchedWithLimit(): void { * respected. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesCriteriaMatchedWithSearchLimit(): void { $this->setupMatchData(); @@ -459,7 +452,6 @@ public function testGetMatchesCriteriaMatchedWithSearchLimit(): void { * Test getting matches where there are no criteria. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesNoCriteria(): void { $this->setupMatchData(); @@ -473,7 +465,6 @@ public function testGetMatchesNoCriteria(): void { * Test getting matches with a limit in play. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMatchesNoCriteriaButLimit(): void { $this->setupMatchData(); @@ -705,7 +696,6 @@ public function testGetMatchesInGroup() { * changes not to imply any contract on the function. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetRowsElementsAndInfoSpecialInfo(): void { $contact1 = $this->individualCreate([ @@ -871,9 +861,7 @@ public function createdDateMergeCases() { * @param $keepContactKey * @param $duplicateContactKey * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testCreatedDatePostMerge($keepContactKey, $duplicateContactKey) { @@ -942,7 +930,6 @@ public function testMigrationOfUnselectedCustomDataOnEmptyCustomRecord() { * no records on the custom group table. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMigrationOfSomeCustomDataOnEmptyCustomRecord() { // Create Custom Fields @@ -996,9 +983,7 @@ public function testMigrationOfSomeCustomDataOnEmptyCustomRecord() { * Test that ContactReference fields are updated to point to the main contact * after a merge is performed and the duplicate contact is deleted. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMigrationOfContactReferenceCustomField() { @@ -1069,9 +1054,7 @@ public function testMigrationOfContactReferenceCustomField() { * Array of fields to be merged from source into target contact, of the form * ['move_' => ] * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ private function mergeContacts($originalContactID, $duplicateContactID, $params): void { $rowsElementsAndInfo = CRM_Dedupe_Merger::getRowsElementsAndInfo($originalContactID, $duplicateContactID); @@ -1170,7 +1153,7 @@ private function setupCustomField($fieldLabel, $createGroup) { /** * Set up some contacts for our matching. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setupMatchData(): void { $fixtures = [ diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index 689ee060b3ed..e4ac8c2d2026 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -140,7 +140,6 @@ protected function addParticipantWithPayment($feeTotal, $actualPaidAmt, $partici /** * See https://lab.civicrm.org/dev/core/issues/153 * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testPaymentWithCustomPaymentInstrument() { @@ -218,7 +217,6 @@ public function testAddPartialPayment() { /** * Test owed/refund info is listed on view payments. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testTransactionInfo() { diff --git a/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php b/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php index d5c833f2bfe3..76eb5250d821 100644 --- a/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php +++ b/tests/phpunit/CRM/Event/BAO/ChangeFeeSelectionTest.php @@ -61,7 +61,6 @@ class CRM_Event_BAO_ChangeFeeSelectionTest extends CiviUnitTestCase { * Set up for test. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); @@ -91,7 +90,6 @@ public function tearDown(): void { * * @return int * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @todo resolve this with parent function. */ protected function priceSetCreate($type = 'Radio') { @@ -274,7 +272,6 @@ public function registerParticipantAndPay($actualPaidAmt = NULL) { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCRM19273() { // When a line item is 'resurrected' the financial_items attached to it are wrong. @@ -304,7 +301,6 @@ public function testCRM19273() { * CRM-21245: Test that Contribution status doesn't changed to 'Pending Refund' from 'Partially Paid' if the partially paid amount is lower then newly selected fee amount * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCRM21245() { $this->registerParticipantAndPay(50); @@ -321,7 +317,6 @@ public function testCRM21245() { * Test that proper financial items are recorded for cancelled line items * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCRM20611() { $this->registerParticipantAndPay(); @@ -374,7 +369,6 @@ public function testCRM20611() { * Test to ensure that correct financial records are entered on text price field fee change on event registration * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCRM21513() { $this->_priceSetID = $this->priceSetCreate('Text'); @@ -479,7 +473,6 @@ public function testCRM21513() { * CRM-17151: Test that Contribution status change to 'Completed' if balance is zero. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCRM17151() { // @todo figure out the financial validation issue - likely a real bug. @@ -523,7 +516,6 @@ public function testCRM17151() { * Test that recording a refund when fee selection is 0 works * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testRefundWithFeeAmount0() { $this->registerParticipantAndPay(); @@ -576,7 +568,6 @@ public function testRefundWithFeeAmount0() { * dev-financial-40: Test that partial payment entries in entity-financial-trxn table to ensure that reverse transaction is entered * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPartialPaymentEntries() { $this->registerParticipantAndPay($this->_expensiveFee); @@ -618,7 +609,6 @@ public function testPartialPaymentEntries() { * dev-financial-40: Test that refund payment entries in entity-financial-trxn table to ensure that reverse transaction is entered on fee change to lesser amount * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testRefundPaymentEntries() { $this->registerParticipantAndPay($this->_expensiveFee); diff --git a/tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php b/tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php index eece2165b585..24dcb83f63a8 100644 --- a/tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php +++ b/tests/phpunit/CRM/Event/Form/ManageEvent/LocationTest.php @@ -14,7 +14,6 @@ class CRM_Event_Form_ManageEvent_LocationTest extends CiviUnitTestCase { /** * Test the right emails exist after submitting the location form twice. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -113,7 +112,6 @@ public function testCreateWithLocBlock() { /** * Test updating a location block. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -242,7 +240,7 @@ protected function getFormValues() { * @param int $eventID * * @return \Civi\Api4\Generic\Result - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function assertCorrectEmails($eventID) { diff --git a/tests/phpunit/CRM/Event/Form/ParticipantTest.php b/tests/phpunit/CRM/Event/Form/ParticipantTest.php index f11e7067f698..498c8bf3d955 100644 --- a/tests/phpunit/CRM/Event/Form/ParticipantTest.php +++ b/tests/phpunit/CRM/Event/Form/ParticipantTest.php @@ -128,7 +128,6 @@ public function testSubmitUnpaidPriceChangeWhileStillPending() { * (dev/core#310) : Test to ensure payments are correctly allocated, when a event fee is changed for a mult-line item event registration * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPaymentAllocationOnMultiLineItemEvent(): void { // USE-CASE : @@ -380,7 +379,6 @@ public function getFromEmailAddress() { * Financial Type: 'Event Fee' and 'Event Fee 2' respectively. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createParticipantRecordsFromTwoFieldPriceSet() { // Create financial type - Event Fee 2 @@ -516,7 +514,6 @@ private function getSubmitParamsForCreditCardPayment(int $paymentProcessorID): a /** * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitWithDeferredRecognition() { Civi::settings()->set('deferred_revenue_enabled', TRUE); @@ -552,7 +549,6 @@ public function testSubmitWithDeferredRecognition() { * @param bool $isQuickConfig * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitPartialPayment($isQuickConfig) { $mut = new CiviMailUtils($this, TRUE); @@ -602,7 +598,6 @@ public function testSubmitPartialPayment($isQuickConfig) { * @param bool $isQuickConfig * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitPendingPartiallyPaidAddPayment($isQuickConfig) { $mut = new CiviMailUtils($this, TRUE); @@ -826,7 +821,6 @@ protected function getRecordContributionParams($participantStatus, $contribution * Check if participant is transferred correctly. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testTransferParticipantRegistration(): void { //Register a contact to a sample event. diff --git a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php index 66aa257215df..6da6f05e7fdc 100644 --- a/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php +++ b/tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php @@ -78,7 +78,6 @@ public function testSubmit(): void { * @param string $thousandSeparator * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * * @dataProvider getThousandSeparators */ @@ -210,7 +209,7 @@ public function testPaidSubmit(string $thousandSeparator): void { * Tests missing contactID when registering for paid event from waitlist * https://github.com/civicrm/civicrm-core/pull/23358, https://lab.civicrm.org/extensions/stripe/-/issues/347 * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testWaitlistRegistrationContactIdParam() { // @todo - figure out why this doesn't pass validate financials @@ -684,7 +683,6 @@ private function uf_field_add($uf_group_id, $field_name, $field_type, $field_lab * email reflects the submitted value * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Exception */ public function testNoteSubmission(): void { diff --git a/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php b/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php index cb7ea1c736c2..aef377b5105a 100644 --- a/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php +++ b/tests/phpunit/CRM/Event/Form/SelfSvcTransferTest.php @@ -12,7 +12,6 @@ class CRM_Event_Form_SelfSvcTransferTest extends CiviUnitTestCase { * Test cancellation. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCancel(): void { $_REQUEST['pid'] = $this->participantCreate(['status_id' => 'Registered']); diff --git a/tests/phpunit/CRM/Event/Form/SelfSvcUpdateTest.php b/tests/phpunit/CRM/Event/Form/SelfSvcUpdateTest.php index 03542d926912..c372eb3b4174 100644 --- a/tests/phpunit/CRM/Event/Form/SelfSvcUpdateTest.php +++ b/tests/phpunit/CRM/Event/Form/SelfSvcUpdateTest.php @@ -12,7 +12,6 @@ class CRM_Event_Form_SelfSvcUpdateTest extends CiviUnitTestCase { * Test cancellation. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testForm(): void { $_REQUEST['pid'] = $this->participantCreate(['status_id' => 'Registered']); diff --git a/tests/phpunit/CRM/Event/Form/Task/BatchTest.php b/tests/phpunit/CRM/Event/Form/Task/BatchTest.php index dda5f5ec24cf..f375583bf958 100644 --- a/tests/phpunit/CRM/Event/Form/Task/BatchTest.php +++ b/tests/phpunit/CRM/Event/Form/Task/BatchTest.php @@ -36,7 +36,6 @@ public function testSubmit() { * Registration'. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitCancel(): void { $this->createEventOrder(['source' => 'Online Event Registration', 'is_pay_later' => 1]); diff --git a/tests/phpunit/CRM/Export/BAO/ExportTest.php b/tests/phpunit/CRM/Export/BAO/ExportTest.php index 887bc02ff179..5d20e2596ab1 100644 --- a/tests/phpunit/CRM/Export/BAO/ExportTest.php +++ b/tests/phpunit/CRM/Export/BAO/ExportTest.php @@ -204,7 +204,7 @@ public function testExportComponentsContributionSoftCredits(): void { * * @throws \CRM_Core_Exception * @throws \League\Csv\Exception - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testExportComponentsMembership(): void { $this->setUpMembershipExportData(); @@ -325,7 +325,6 @@ public function testExportComponentsMembership(): void { * Basic test to ensure the exportComponents function can export selected fields for activity * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportComponentsActivity(): void { @@ -408,7 +407,6 @@ public function testGetExportStructureArrays(): void { * Set up some data for us to do testing on. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUpContributionExportData(): void { $this->setUpContactExportData(); @@ -420,7 +418,6 @@ public function setUpContributionExportData(): void { * Set up some data for us to do testing on. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function setUpMembershipExportData(): void { $this->setUpContactExportData(); @@ -442,7 +439,6 @@ public function setUpMembershipExportData(): void { * Set up data to test case export. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setupCaseExportData(): void { $contactID1 = $this->individualCreate(); @@ -463,7 +459,6 @@ public function setupCaseExportData(): void { * Set up some data for us to do testing on. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUpActivityExportData(): void { $this->setUpContactExportData(); @@ -516,7 +511,6 @@ public function setUpContactExportData(): void { * @param int $isPrimaryOnly * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception * @dataProvider getBooleanDataProvider */ @@ -554,7 +548,6 @@ public function testExportPrimaryAddress($isPrimaryOnly): void { * does NOT retain the gender of the former. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportPseudoField(): void { @@ -599,7 +592,6 @@ public function testExportPseudoFieldCampaign(): void { * Test exporting relationships. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportRelationships(): void { @@ -725,9 +717,7 @@ public function testExportRelationshipsMergeToHouseholdAllFields(): void { /** * Test custom data exporting. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException * @throws \League\Csv\Exception */ @@ -774,7 +764,6 @@ public function testExportCustomData(): void { * Attempt to do a fairly full export of location data. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportIMData(): void { @@ -860,9 +849,7 @@ public function testExportIMData(): void { * * Less over the top complete than the im test. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException * @throws \League\Csv\Exception */ @@ -939,7 +926,6 @@ public function testExportPhoneData(): void { * Export City against multiple location types. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportAddressData(): void { @@ -1052,7 +1038,6 @@ public function testExportAddressData(): void { * Test master_address_id field when no merge is in play. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportMasterAddress(): void { @@ -1074,7 +1059,6 @@ public function testExportMasterAddress(): void { * Test merging same address when specifying fields. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testMergeSameAddressSpecifyFields(): void { @@ -1086,7 +1070,6 @@ public function testMergeSameAddressSpecifyFields(): void { * Test the merge same address option. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testMergeSameAddress(): void { @@ -1190,7 +1173,6 @@ public function testMergeSameAddress(): void { * Tests the options for greeting templates when choosing to merge same address. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testMergeSameAddressGreetingOptions(): void { @@ -1258,7 +1240,6 @@ public function testExportNoRows(): void { * So C take preference over A and thus C is exported as result. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testMergeSameAddressOnExport(): void { @@ -1385,7 +1366,6 @@ public function getReasonsNotToMail(): array { * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function setUpHousehold(): array { $this->setUpContactExportData(); @@ -1889,7 +1869,6 @@ public function testGetSQLColumnsAndHeaders($exportMode, $expected, $expectedHea * https://lab.civicrm.org/dev/core/issues/819 * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \League\Csv\Exception */ public function testExportIncompleteSubmission(): void { @@ -2168,7 +2147,6 @@ public function getAllSpecifiableParticipantReturnFields(): array { * @param string $exportMode * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setupBaseExportData($exportMode): void { $this->createLoggedInUser(); @@ -2985,7 +2963,6 @@ protected function assertExpectedOutput(array $expected, array $row, array $alte * Test get preview function on export processor. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testExportGetPreview(): void { $this->setUpContactExportData(); @@ -3025,7 +3002,6 @@ public function testExportGetPreview(): void { * Set up contacts which will be merged with the same address option. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function setUpContactSameAddressExportData(): void { $this->setUpContactExportData(); diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php index 208f5ea27466..298415a094e7 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php @@ -110,9 +110,7 @@ public function testDel() { /** * Check delete fails if a related contribution exists. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteIfHasContribution(): void { $financialType = FinancialType::create(FALSE)->setValues([ diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php index db84c19a23e6..d39eeb58a7f8 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialItemTest.php @@ -39,7 +39,7 @@ public function tearDown(): void { /** * Check method add() * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testAdd(): void { $price = 100; @@ -80,7 +80,7 @@ public function testAdd(): void { /** * Check method retrieve() * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testRetrieve(): void { $price = 100.00; @@ -119,8 +119,7 @@ public function testRetrieve(): void { /** * Check method create() * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testCreate(): void { $contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php index a79e7b2b4715..fa760949d01e 100644 --- a/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php +++ b/tests/phpunit/CRM/Financial/BAO/FinancialTypeTest.php @@ -177,7 +177,7 @@ public function testGetAvailableFinancialTypes() { /** * Check method test getAvailableMembershipTypes() * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGetAvailableMembershipTypes(): void { // Create Membership types @@ -223,7 +223,6 @@ public function testGetAvailableMembershipTypes(): void { * Check method testcheckPermissionedLineItems() * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCheckPermissionedLineItems() { $contactId = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTest.php b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTest.php index 6cea4c727df9..fafef3ef7c29 100644 --- a/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTest.php +++ b/tests/phpunit/CRM/Financial/BAO/PaymentProcessorTest.php @@ -48,8 +48,7 @@ public function testGetCreditCards() { /** * Test the processor retrieval function. * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testGetProcessors() { diff --git a/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php b/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php index a043d8b43ab0..9a55311b11b1 100644 --- a/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php +++ b/tests/phpunit/CRM/Financial/Form/PaymentEditTest.php @@ -40,7 +40,6 @@ public function tearDown(): void { * Test the submit function of payment edit form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\Payment\Exception\PaymentProcessorException */ public function testSubmitOnPaymentInstrumentChange(): void { diff --git a/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php b/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php index 4e0e78578863..fde69818b49b 100644 --- a/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php +++ b/tests/phpunit/CRM/Financial/Form/PaymentFormsTest.php @@ -35,7 +35,6 @@ class CRM_Financial_Form_PaymentFormsTest extends CiviUnitTestCase { * Generic test on event payment forms to make sure they submit without error with payment processing. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testEventPaymentForms() { $this->createAuthorizeNetProcessor(); diff --git a/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php b/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php index 992db7706c9b..4b621e58c171 100644 --- a/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php +++ b/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php @@ -21,7 +21,6 @@ class CRM_Financial_Page_AjaxBatchSummaryTest extends CiviUnitTestCase { * We want to ensure changing the method of obtaining status and payment_instrument * does not cause any regression. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testMakeBatchSummary(): void { diff --git a/tests/phpunit/CRM/Import/DataSource/CsvTest.php b/tests/phpunit/CRM/Import/DataSource/CsvTest.php index 7f642e6c5bf2..fe4ed7829db8 100644 --- a/tests/phpunit/CRM/Import/DataSource/CsvTest.php +++ b/tests/phpunit/CRM/Import/DataSource/CsvTest.php @@ -32,7 +32,6 @@ public function setUp(): void { * * @dataProvider getCsvFiles * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testToCsv(array $fileData): void { @@ -134,7 +133,6 @@ public function trimDataProvider(): array { * skipped because of some checking for column-count matches in the import, * and so you don't hit the current fail. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testBlankLineAtEnd(): void { @@ -153,7 +151,6 @@ public function testBlankLineAtEnd(): void { * * @return \CRM_Contact_Import_Form_DataSource * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function submitDatasourceForm(string $csvFileName): CRM_Contact_Import_Form_DataSource { diff --git a/tests/phpunit/CRM/Logging/LoggingTest.php b/tests/phpunit/CRM/Logging/LoggingTest.php index 9523645f112d..8922274e2ff7 100644 --- a/tests/phpunit/CRM/Logging/LoggingTest.php +++ b/tests/phpunit/CRM/Logging/LoggingTest.php @@ -25,7 +25,7 @@ public function tearDown(): void { * Check that log tables are created even for non standard custom fields * tables. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testLoggingNonStandardCustomTableName(): void { $this->createCustomGroupWithFieldOfType(['table_name' => 'abcd']); diff --git a/tests/phpunit/CRM/Logging/SchemaTest.php b/tests/phpunit/CRM/Logging/SchemaTest.php index 70e014bd9fd8..2eeb95e0ace3 100644 --- a/tests/phpunit/CRM/Logging/SchemaTest.php +++ b/tests/phpunit/CRM/Logging/SchemaTest.php @@ -16,9 +16,7 @@ public function setUp(): void { /** * Clean up after test. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $schema = new CRM_Logging_Schema(); @@ -235,7 +233,7 @@ public function testTriggerInfo() { } /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testColumnInfo(): void { CRM_Core_DAO::executeQuery("CREATE TABLE `civicrm_test_column_info` ( diff --git a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php index 53289cf06d85..bcea77dc581b 100644 --- a/tests/phpunit/CRM/Mailing/BAO/MailingTest.php +++ b/tests/phpunit/CRM/Mailing/BAO/MailingTest.php @@ -273,9 +273,7 @@ public function hook_civicrm_aclGroup($type, $contactID, $tableName, &$allGroups * that has 'contact 1' identified as $contactIDs[0] and Included in the * mailing recipient list * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception - * @throws \API_Exception * @group locale */ public function testGetRecipientsEmailGroupIncludeExclude(): void { diff --git a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php index 30ad9609e17a..3f1aa6d8d48c 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipLogTest.php @@ -63,7 +63,6 @@ class CRM_Member_BAO_MembershipLogTest extends CiviUnitTestCase { * Set up for test. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function setUp(): void { parent::setUp(); @@ -100,7 +99,7 @@ public function setUp(): void { /** * Tears down the fixture. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function tearDown(): void { $this->relationshipTypeDelete($this->relationshipTypeID); @@ -114,7 +113,6 @@ public function tearDown(): void { * Test del function. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDel() { list($contactID, $membershipID) = $this->setupMembership(); diff --git a/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php b/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php index 156b40ed7d74..af78ef042b6b 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipStatusTest.php @@ -113,7 +113,6 @@ public function testDel() { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testExpiredDisabled() { $this->callAPISuccess('MembershipStatus', 'get', [ diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index 616998c9c0b5..0cc6299bf9cc 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -21,7 +21,6 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Exception */ public function setUp(): void { @@ -35,9 +34,7 @@ public function setUp(): void { * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $this->_membershipStatusID = $this->_membershipTypeID = NULL; @@ -91,7 +88,6 @@ private function getRelatedMembershipsCount($membershipId) { * Test to delete related membership when type of parent membership is changed which does not have relation type associated. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteRelatedMembershipsOnParentTypeChanged(): void { @@ -139,7 +135,6 @@ public function testDeleteRelatedMembershipsOnParentTypeChanged(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreate(): void { @@ -171,7 +166,6 @@ public function testCreate(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetValues(): void { // $this->markTestSkipped( 'causes mysterious exit, needs fixing!' ); @@ -232,7 +226,6 @@ public function testGetValues(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testRetrieve(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -247,7 +240,6 @@ public function testRetrieve(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testActiveMembers(): void { $contactId = $this->individualCreate(); @@ -311,7 +303,6 @@ public function testActiveMembers(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteMembership(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -328,7 +319,6 @@ public function testDeleteMembership(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetContactMembership(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -390,7 +380,6 @@ public function testGetAllContactMembership() { * page id from the membership record * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetContributionPageId(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -406,7 +395,6 @@ public function testGetContributionPageId(): void { * type. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMembershipStarts(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -423,7 +411,6 @@ public function testGetMembershipStarts(): void { * optionally for a specified date. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetMembershipCount(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -439,7 +426,6 @@ public function testGetMembershipCount(): void { * Checkup sort name function. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSortName(): void { $contactId = $this->individualCreate(); @@ -467,7 +453,6 @@ public function testSortName(): void { * Delete related memberships. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeleteRelatedMemberships(): void { [$contactId, $membershipId] = $this->setupMembership(); @@ -486,7 +471,6 @@ public function testDeleteRelatedMemberships(): void { * renewal Failed asserting that two strings are equal. * Expected-'2021-03-01' Actual+'2021-02-28' * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testRenewMembership(): void { $contactId = $this->individualCreate(); @@ -541,7 +525,6 @@ public function testRenewMembership(): void { * Renew stale membership. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testStaleMembership(): void { $statusId = 3; @@ -596,7 +579,6 @@ public function testStaleMembership(): void { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testUpdateAllMembershipStatusConvertExpiredOverriddenStatusToNormal(): void { $params = [ @@ -627,7 +609,6 @@ public function testUpdateAllMembershipStatusConvertExpiredOverriddenStatusToNor /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testUpdateAllMembershipStatusHandleOverriddenWithEndOverrideDateEqualTodayAsExpired(): void { $params = [ @@ -658,7 +639,6 @@ public function testUpdateAllMembershipStatusHandleOverriddenWithEndOverrideDate /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testUpdateAllMembershipStatusDoesNotConvertOverriddenMembershipWithoutEndOverrideDateToNormal(): void { $params = [ @@ -688,7 +668,6 @@ public function testUpdateAllMembershipStatusDoesNotConvertOverriddenMembershipW /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMembershipPaymentForSingleContributionMultipleMembership(): void { $membershipTypeID1 = $this->membershipTypeCreate(['name' => 'Parent']); @@ -826,7 +805,7 @@ public function testMembershipPaymentForSingleContributionMultipleMembership(): /** * Test the buildMembershipTypeValues function. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testBuildMembershipTypeValues(): void { $this->restoreMembershipTypes(); @@ -858,7 +837,6 @@ public function testBuildMembershipTypeValues(): void { /** * @return array * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function setupMembership(): array { $contactId = $this->individualCreate(); @@ -1005,7 +983,7 @@ public function testRelatedMembershipWithContactReferenceCustomField() { * @param int $count * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ private function createContacts(int $count): array { $contacts = []; diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php index f957946ca346..4037b9f82e1a 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTypeTest.php @@ -54,7 +54,7 @@ public function tearDown(): void { /** * Test add. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testAdd(): void { $params = [ @@ -83,7 +83,7 @@ public function testAdd(): void { /** * Test retrieve(). * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testRetrieve(): void { $params = [ @@ -110,7 +110,7 @@ public function testRetrieve(): void { /** * Test setIsActive. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testSetIsActive(): void { $params = [ @@ -141,7 +141,7 @@ public function testSetIsActive(): void { /** * Test delete. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testDelete(): void { $membershipTypeID = $this->createGeneralMembershipType(); @@ -152,7 +152,7 @@ public function testDelete(): void { /** * Test convertDayFormat. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testConvertDayFormat(): void { $params = [ @@ -181,7 +181,7 @@ public function testConvertDayFormat(): void { /** * Test getMembershipTypes. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGetMembershipTypes(): void { $params = [ @@ -218,7 +218,7 @@ public function testGetMembershipTypeDetails(): void { /** * Test getDatesForMembershipType. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGetDatesForMembershipType(): void { $params = [ @@ -244,7 +244,7 @@ public function testGetDatesForMembershipType(): void { /** * Test getRenewalDatesForMembershipType. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGetRenewalDatesForMembershipType(): void { $params = [ @@ -288,7 +288,7 @@ public function testGetRenewalDatesForMembershipType(): void { /** * Test getMembershipTypesByOrg. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGetMembershipTypesByOrg(): void { $params = [ @@ -350,7 +350,7 @@ private function createGeneralMembershipType(): int { ->execute() ->first()['id']; } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail($e->getMessage()); return 0; } diff --git a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php index d8f5bc882dcb..198266bc1829 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipRenewalTest.php @@ -136,9 +136,7 @@ public function tearDown(): void { /** * Test the submit function of the membership form. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmit(): void { $loggedInUserID = $this->createLoggedInUser(); @@ -186,7 +184,6 @@ public function testSubmit(): void { * Test submitting with tax enabled. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitWithTax(): void { $this->enableTaxAndInvoicing(); @@ -205,9 +202,7 @@ public function testSubmitWithTax(): void { * * https://lab.civicrm.org/dev/core/-/issues/2024 * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitWithTaxOfZero(): void { @@ -228,7 +223,6 @@ public function testSubmitWithTaxOfZero(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitChangeType(): void { $form = $this->getForm(); @@ -255,7 +249,6 @@ public function testSubmitChangeType(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitRecur(): void { $mut = new CiviMailUtils($this); @@ -349,7 +342,6 @@ public function testSubmitRecur(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitRecurCompleteInstant(): void { /** @var \CRM_Core_Payment_Dummy $processor */ @@ -428,9 +420,7 @@ public function testSubmitRecurCompleteInstant(): void { * * @param string $thousandSeparator * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider getThousandSeparators */ public function testSubmitRecurCompleteInstantWithMail(string $thousandSeparator): void { @@ -469,7 +459,6 @@ public function testMailOutput(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitPayLater(): void { $this->createLoggedInUser(); @@ -518,7 +507,6 @@ public function testSubmitPayLater(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitPayLaterWithBilling(): void { $this->createLoggedInUser(); @@ -578,7 +566,6 @@ public function testSubmitPayLaterWithBilling(): void { * Test the submit function of the membership form. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitComplete(): void { $this->createLoggedInUser(); @@ -635,7 +622,6 @@ public function testSubmitComplete(): void { * @return \CRM_Member_Form_MembershipRenewal * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function getForm($formValues = [], $mode = 'test'): CRM_Member_Form_MembershipRenewal { /** @var CRM_Member_Form_MembershipRenewal $form */ @@ -687,7 +673,6 @@ protected function getBaseSubmitParams(): array { * Test renewing an expired membership. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitRenewExpired(): void { $form = $this->getForm([], NULL); @@ -772,7 +757,7 @@ protected function submitInstantCardRenewal(): void { ->addWhere('membership_type_id', '=', $this->membershipTypeAnnualFixedID) ->addSelect('id')->execute()->first()['id']; } - catch (API_Exception | CRM_Core_Exception | CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception | CRM_Core_Exception | CRM_Core_Exception $e) { $this->fail($e->getMessage() . "\n" . $e->getTraceAsString()); } } diff --git a/tests/phpunit/CRM/Member/Form/MembershipTest.php b/tests/phpunit/CRM/Member/Form/MembershipTest.php index cf247bb0274b..f912a9a1815e 100644 --- a/tests/phpunit/CRM/Member/Form/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Form/MembershipTest.php @@ -173,7 +173,6 @@ public function tearDown(): void { * Test CRM_Member_Form_Membership::formRule() with a parameter * that has an empty contact_select_id value * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testFormRuleEmptyContact(): void { @@ -285,7 +284,6 @@ public function testFormRuleRollingLifetimeEnd() { * Test CRM_Member_Form_Membership::formRule() with a parameter * that has permanent override and no status * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testFormRulePermanentOverrideWithNoStatus() { @@ -480,7 +478,6 @@ public function testFormRuleFixedJoin6MonthsAgo() { * @param string $thousandSeparator * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * * @dataProvider getThousandSeparators */ @@ -589,8 +586,6 @@ public function testSubmit(string $thousandSeparator): void { * behaviour. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function testSubmitUnpaid(): void { $this->mut = new CiviMailUtils($this, TRUE); @@ -619,7 +614,6 @@ public function testSubmitUnpaid(): void { * Check if the related contribution is also updated if the minimum_fee didn't match * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContributionUpdateOnMembershipTypeChange(): void { // @todo figure out why financial validation fails with this test. @@ -724,7 +718,6 @@ public function testContributionUpdateOnMembershipTypeChange(): void { * punctuation used to refer to thousands. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider getThousandSeparators */ public function testSubmitPartialPayment(string $thousandSeparator): void { @@ -796,9 +789,7 @@ public function testSubmitPartialPayment(string $thousandSeparator): void { /** * Test the submit function of the membership form. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitRecur(): void { CRM_Core_Session::singleton()->getStatus(TRUE); @@ -862,8 +853,6 @@ public function testSubmitRecur(): void { * Test submit recurring with two line items. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception - * @throws \API_Exception */ public function testSubmitRecurTwoRows(): void { $this->createMembershipPriceSet(); @@ -899,7 +888,6 @@ public function testSubmitRecurTwoRows(): void { * after related Contribution is cancelled * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testFinancialEntriesOnCancelledContribution(): void { // @todo figure out why financial validation fails with this test. @@ -1046,7 +1034,6 @@ public function testSubmitPayLaterWithBilling(): void { * is updated from Partially paid to Completed. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitUpdateMembershipFromPartiallyPaid(): void { $memStatus = CRM_Member_BAO_Membership::buildOptions('status_id', 'validate'); @@ -1087,7 +1074,6 @@ public function testSubmitUpdateMembershipFromPartiallyPaid(): void { /** * Test the submit function of the membership form. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testSubmitRecurCompleteInstant(): void { @@ -1160,7 +1146,6 @@ public function testSubmitRecurCompleteInstant(): void { * Uses some data from tests/phpunit/CRM/Member/Form/dataset/data.xml . * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testTwoInheritedMembershipsViaPriceSetInBackend(): void { // Create an organization and give it a "Member of" relationship to $this->_individualId. @@ -1240,7 +1225,6 @@ public function testTwoInheritedMembershipsViaPriceSetInBackend(): void { * checking that the line items have correct amounts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testTwoMembershipsViaPriceSetInBackendWithDiscount(): void { // Register buildAmount hook to apply discount. @@ -1301,7 +1285,6 @@ public function buildAmountMembershipDiscount($pageType, &$form, &$amount) { * * @return \CRM_Member_Form_Membership * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function getForm(array $formValues = []): CRM_Member_Form_Membership { if (isset($_REQUEST['cid'])) { @@ -1369,7 +1352,6 @@ protected function getBaseSubmitParams(): array { * applied - this overloading would ideally be cleaned up. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createTwoMembershipsViaPriceSetInBackEnd(int $contactId, $isTaxEnabled = TRUE): void { $form = $this->getForm(); @@ -1440,7 +1422,6 @@ protected function getContributionForm(array $formValues): CRM_Contribute_Form_C * In addition (a data-integrity check) -> check that the LineItem data add up to the data at the Contribution level * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testLineItemAmountOnSalesTax(): void { $this->enableTaxAndInvoicing(); @@ -1524,7 +1505,6 @@ public function testLineItemAmountOnSalesTax(): void { /** * Test that membership end_date is correct for multiple terms for pending contribution * - * @throws CiviCRM_API3_Exception * @throws \CRM_Core_Exception * @throws \Exception */ @@ -1605,7 +1585,6 @@ public function testCreatePendingWithMultipleTerms() { * is other contact. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Exception */ public function testMembershipViewContributionOwnerDifferent() { diff --git a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php index 7c6e54ae5351..21a4babdc4aa 100644 --- a/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php +++ b/tests/phpunit/CRM/Member/Import/Parser/MembershipTest.php @@ -59,7 +59,6 @@ class CRM_Member_Import_Parser_MembershipTest extends CiviUnitTestCase { * Set up for test. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); @@ -367,8 +366,7 @@ protected function getUserJobID(array $submittedValues = []): int { /** * Test importing to a custom field. * - * @throws \API_Exception - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testImportCustomData(): void { $donaldDuckID = $this->individualCreate(['first_name' => 'Donald', 'last_name' => 'Duck']); diff --git a/tests/phpunit/CRM/Member/Selector/SearchTest.php b/tests/phpunit/CRM/Member/Selector/SearchTest.php index 709749b9fba7..2c9463180d09 100644 --- a/tests/phpunit/CRM/Member/Selector/SearchTest.php +++ b/tests/phpunit/CRM/Member/Selector/SearchTest.php @@ -19,7 +19,7 @@ class CRM_Member_Selector_SearchTest extends CiviUnitTestCase { /** * Test results from getRows. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testSelectorGetRows(): void { $this->_contactID = $this->individualCreate(); diff --git a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php index 1fc9d8f55938..6860097c8809 100644 --- a/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php +++ b/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php @@ -411,7 +411,6 @@ public function testCreatePledgePaymentForMultipleInstallments() { * recalculates the 'amount' using original_installment_amount * installment. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreatePledgePaymentForMultipleInstallments2(): void { $scheduled_date = date('Ymd', mktime(0, 0, 0, date("m"), date("d") + 2, date("y"))); diff --git a/tests/phpunit/CRM/Pledge/Form/PledgeTest.php b/tests/phpunit/CRM/Pledge/Form/PledgeTest.php index 4f3eecb3af5a..d6b9f2daa1da 100644 --- a/tests/phpunit/CRM/Pledge/Form/PledgeTest.php +++ b/tests/phpunit/CRM/Pledge/Form/PledgeTest.php @@ -12,7 +12,6 @@ class CRM_Pledge_Form_PledgeTest extends CiviUnitTestCase { /** * Test the post process function. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testPostProcess(): void { diff --git a/tests/phpunit/CRM/Profile/Form/EditTest.php b/tests/phpunit/CRM/Profile/Form/EditTest.php index 863416730c60..500fde0ea702 100644 --- a/tests/phpunit/CRM/Profile/Form/EditTest.php +++ b/tests/phpunit/CRM/Profile/Form/EditTest.php @@ -25,7 +25,7 @@ public function tearDown(): void { /** * Test the url on the profile edit form renders tokens * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testProfileUrl(): void { $profileID = Civi\Api4\UFGroup::create(FALSE)->setValues([ @@ -49,7 +49,7 @@ public function testProfileUrl(): void { /** * Test that requiring tags on a profile works. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testProfileRequireTag(): void { $ufGroupParams = [ diff --git a/tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php b/tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php index e8fe82dd3f24..188eb3ac59f3 100644 --- a/tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php +++ b/tests/phpunit/CRM/Upgrade/Incremental/BaseTest.php @@ -44,7 +44,7 @@ public function testMessageTemplateUpgrade(): void { /** * Test that a string replacement in a message template can be done. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testMessageTemplateStringReplace(): void { MessageTemplate::update()->setValues(['msg_html' => '{$display_name}'])->addWhere( @@ -70,7 +70,7 @@ public function testMessageTemplateStringReplace(): void { /** * Test that a $this->string replacement in a message template can be done. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testActionScheduleStringReplace(): void { ActionSchedule::create(FALSE)->setValues([ diff --git a/tests/phpunit/CRM/Utils/TokenConsistencyTest.php b/tests/phpunit/CRM/Utils/TokenConsistencyTest.php index 9d30bc3b2fbd..6c6f9fc6cafa 100644 --- a/tests/phpunit/CRM/Utils/TokenConsistencyTest.php +++ b/tests/phpunit/CRM/Utils/TokenConsistencyTest.php @@ -59,7 +59,7 @@ public function tearDown(): void { /** * Test that case tokens are consistently rendered. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testCaseTokenConsistency(): void { $this->createLoggedInUser(); @@ -472,7 +472,7 @@ protected function getExpectedContributionRecurTokenOutPut(): string { /** * Test that membership tokens are consistently rendered. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testMembershipTokenConsistency(): void { $this->createLoggedInUser(); @@ -647,7 +647,7 @@ protected function getExpectedMembershipTokenOutput(): string { /** * Test that membership tokens are consistently rendered. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testParticipantTokenConsistency(): void { $this->createLoggedInUser(); @@ -679,7 +679,6 @@ public function testParticipantTokenConsistency(): void { /** * Test that membership tokens are consistently rendered. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testParticipantCustomDateToken(): void { @@ -749,7 +748,6 @@ public function testDomainTokenConsistency(): void { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testDomainNow(): void { @@ -819,7 +817,7 @@ public function getDomainTokens(): array { /** * Test that event tokens are consistently rendered. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testEventTokenConsistency(): void { $mut = new CiviMailUtils($this); @@ -852,7 +850,7 @@ public function testEventTokenConsistency(): void { /** * Test that event tokens work absent participant tokens. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testEventTokenConsistencyNoParticipantTokens(): void { $mut = new CiviMailUtils($this); @@ -883,7 +881,7 @@ public function testEventTokenConsistencyNoParticipantTokens(): void { /** * Set up scheduled reminder for participants. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function setupParticipantScheduledReminder($includeParticipant = TRUE): void { $this->createEventAndParticipant(); @@ -946,7 +944,7 @@ protected function getTokenString(array $tokens): string { /** * Create an event with a participant. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function createEventAndParticipant(): void { $this->createCustomGroupWithFieldOfType(['extends' => 'Event']); diff --git a/tests/phpunit/CRMTraits/Custom/CustomDataTrait.php b/tests/phpunit/CRMTraits/Custom/CustomDataTrait.php index 5d1f0786fa63..479b825b9570 100644 --- a/tests/phpunit/CRMTraits/Custom/CustomDataTrait.php +++ b/tests/phpunit/CRMTraits/Custom/CustomDataTrait.php @@ -52,7 +52,7 @@ public function createCustomGroup(array $params = []): int { ->execute() ->first()['id']; } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail('Could not create group ' . $e->getMessage()); } return $this->ids['CustomGroup'][$identifier]; @@ -192,7 +192,7 @@ protected function getCustomFieldName(string $key = 'text', int $version = 3): s * @param array $values * * @return int - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function addOptionToCustomField(string $key, array $values): int { $optionGroupID = CustomField::get(FALSE) diff --git a/tests/phpunit/CRMTraits/Financial/PriceSetTrait.php b/tests/phpunit/CRMTraits/Financial/PriceSetTrait.php index 8e3670d5ee00..d40ba989cf76 100644 --- a/tests/phpunit/CRMTraits/Financial/PriceSetTrait.php +++ b/tests/phpunit/CRMTraits/Financial/PriceSetTrait.php @@ -123,8 +123,7 @@ protected function createMembershipPriceSet(): void { * * @param array $membershipTypeParams * - * @throws \API_Exception - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ protected function setUpMembershipBlockPriceSet(array $membershipTypeParams = []): void { $this->ids['PriceSet']['membership_block'] = PriceSet::create(FALSE) diff --git a/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php b/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php index 31c58aeb9bda..20558b3a563c 100644 --- a/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php +++ b/tests/phpunit/CRMTraits/PCP/PCPTestTrait.php @@ -52,7 +52,7 @@ public function pcpBlockParams() { * Create the necessary initial objects for a pcp page, then return the * params needed to create the pcp page. * - * @throw API_Exception + * @throw CRM_Core_Exception */ public function pcpParams() { $contact = CRM_Core_DAO::createTestObject('CRM_Contact_DAO_Contact'); diff --git a/tests/phpunit/Civi/API/KernelTest.php b/tests/phpunit/Civi/API/KernelTest.php index 0831247f7dd7..e5702e2718e8 100644 --- a/tests/phpunit/Civi/API/KernelTest.php +++ b/tests/phpunit/Civi/API/KernelTest.php @@ -51,7 +51,7 @@ public function testNormalEvents() { public function testResolveException() { $test = $this; $this->dispatcher->addListener('civi.api.resolve', function () { - throw new \API_Exception('Oh My God', 'omg', ['the' => 'badzes']); + throw new \CRM_Core_Exception('Oh My God', 'omg', ['the' => 'badzes']); }, Events::W_EARLY); $this->dispatcher->addListener('civi.api.exception', function (\Civi\API\Event\ExceptionEvent $event) use ($test) { $test->assertEquals('Oh My God', $event->getException()->getMessage()); diff --git a/tests/phpunit/Civi/API/RequestTest.php b/tests/phpunit/Civi/API/RequestTest.php index 384d6bee05d8..83d85f7a4a1c 100644 --- a/tests/phpunit/Civi/API/RequestTest.php +++ b/tests/phpunit/Civi/API/RequestTest.php @@ -33,7 +33,7 @@ public function validEntityActionPairs() { * @dataProvider validEntityActionPairs * @param $input * @param $expected - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testCreateRequest_EntityActionMunging($input, $expected) { list ($inEntity, $inAction, $inVersion) = $input; diff --git a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php index 46d30d7f929b..706e2c0623f4 100644 --- a/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php +++ b/tests/phpunit/Civi/API/Subscriber/TransactionSubscriberTest.php @@ -93,7 +93,7 @@ public function transactionOptions() { * @param bool $isForceRollback * @param bool $isNested * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testTransactionOptions($version, $entity, $action, $params, $isTransactional, $isForceRollback, $isNested) { $txs = new TransactionSubscriber(); diff --git a/tests/phpunit/Civi/Test/ExampleHookTest.php b/tests/phpunit/Civi/Test/ExampleHookTest.php index efc59ebfdee0..7d431a7369e9 100644 --- a/tests/phpunit/Civi/Test/ExampleHookTest.php +++ b/tests/phpunit/Civi/Test/ExampleHookTest.php @@ -96,7 +96,7 @@ public function testPageOutput(): void { /** * Test getfields calls hooks. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testGetFields(): void { $this->assertEquals([], $this->tracker['civi.api.resolve']); diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index ab7d7c8915d9..6b0d304ee18a 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -518,7 +518,7 @@ public function createDomainContacts(): void { 'label' => '"FIXME" ', ])->setRecords([['domain_id' => 1], ['domain_id' => 2]])->execute(); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail('failed to re-instate domain contacts ' . $e->getMessage()); } } @@ -567,7 +567,6 @@ protected function tearDown(): void { /** * CHeck that all tests that have created payments have created them with the right financial entities. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function assertPostConditions(): void { @@ -920,7 +919,7 @@ public function processorCreate($params = []) { * @return \CRM_Core_Payment_Dummy * Instance of Dummy Payment Processor * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function dummyProcessorCreate($processorParams = []) { $paymentProcessorID = $this->processorCreate($processorParams); @@ -1505,7 +1504,6 @@ public function contactGroupDelete($contactId) { * @return array|int * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function activityCreate($params = []) { $params = array_merge([ @@ -1946,7 +1944,7 @@ public function quickCleanUpFinancialEntities(): void { [['name', 'LIKE', 'Financial-Type -%'], ['name', 'LIKE', 'Sales tax %']] )->execute(); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail('failed to cleanup financial types ' . $e->getMessage()); } CRM_Core_PseudoConstant::flush('taxRates'); @@ -1969,7 +1967,7 @@ public function restoreDefaultPriceSetConfig(): void { /** * Recreate default membership types. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function restoreMembershipTypes(): void { MembershipType::delete(FALSE)->addWhere('id', '>', 0)->execute(); @@ -2485,7 +2483,7 @@ public function setupRecurringPaymentProcessorTransaction(array $recurParams = [ * * @param array $params Optionally modify params for membership/recur (duration_unit/frequency_unit) * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function setupMembershipRecurringPaymentProcessorTransaction($params = []): void { $membershipParams = $recurParams = []; @@ -2943,7 +2941,7 @@ protected function cleanUpSetUpIDs() { try { civicrm_api3($entity, 'delete', ['id' => $id, 'skip_undelete' => 1]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // This is a best-effort cleanup function, ignore. } } @@ -3432,7 +3430,7 @@ protected function getContributionObject($contributionID) { * * @param bool $teardown * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setupForSmsTests($teardown = FALSE) { require_once 'CiviTest/CiviTestSMSProvider.php'; @@ -3608,7 +3606,7 @@ protected function validateAllPayments(): void { /** * Validate all created contributions. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function validateAllContributions(): void { $contributions = Contribution::get(FALSE)->setSelect(['total_amount', 'tax_amount'])->execute(); @@ -3847,7 +3845,7 @@ protected function ensureMySQLMode(array $modes): void { /** * Delete any extraneous relationship types. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function deleteNonDefaultRelationshipTypes(): void { @@ -3880,7 +3878,7 @@ protected function cleanupCustomGroups(): void { CustomGroup::delete(FALSE)->addWhere('id', '>', 0)->execute(); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->fail('failed to cleanup custom groups ' . $e->getMessage()); } } diff --git a/tests/phpunit/api/v3/ACLCachingTest.php b/tests/phpunit/api/v3/ACLCachingTest.php index 367d5beec6c6..4f24ffefe4c3 100644 --- a/tests/phpunit/api/v3/ACLCachingTest.php +++ b/tests/phpunit/api/v3/ACLCachingTest.php @@ -29,7 +29,6 @@ public function setUp(): void { * (non-PHPdoc) * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @see CiviUnitTestCase::tearDown() */ public function tearDown(): void { diff --git a/tests/phpunit/api/v3/ACLPermissionTest.php b/tests/phpunit/api/v3/ACLPermissionTest.php index dae2760d5851..dbd1c85a87f6 100644 --- a/tests/phpunit/api/v3/ACLPermissionTest.php +++ b/tests/phpunit/api/v3/ACLPermissionTest.php @@ -187,7 +187,7 @@ public function testAddressWithoutContactIDAccess(int $version): void { * * @param int $version * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @dataProvider versionThreeAndFour */ public function testRelatedEntityPermissions(int $version): void { @@ -625,7 +625,6 @@ public function testGetActivityNoPermissions(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityViewAllActivitiesDoesntCutItAnymore(int $version): void { @@ -657,7 +656,6 @@ public function testGetActivityViewAllContactsEnoughWithoutID(int $version): voi * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityViewAllContactsEnoughWIthID(int $version): void { @@ -676,7 +674,6 @@ public function testGetActivityViewAllContactsEnoughWIthID(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityAccessCiviCRMEnough(int $version): void { @@ -706,7 +703,6 @@ public function testGetActivityAccessCiviCRMEnough(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityCheckPermissionsByComponent(int $version): void { @@ -734,7 +730,6 @@ public function testGetActivityCheckPermissionsByComponent(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityCheckPermissionsByCaseComponent(int $version): void { @@ -770,7 +765,6 @@ public function testGetActivityCheckPermissionsByCaseComponent(int $version): vo * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityByACL(int $version): void { @@ -796,7 +790,7 @@ public function testGetActivityByACL(int $version): void { * To leverage ACL permission to view an activity you must be able to see any * of the contacts. FIXME: Api4 * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testGetActivityByAclCannotViewAllContacts(): void { $activity = $this->activityCreate(['assignee_contact_id' => $this->individualCreate()]); @@ -842,7 +836,6 @@ public function testGetActivityByAclCannotViewAllContacts(): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetActivityByAclCannotViewAnyContacts(int $version): void { @@ -867,7 +860,6 @@ public function testGetActivityByAclCannotViewAnyContacts(int $version): void { * @param int $version * * @dataProvider versionThreeAndFour - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testGetActivityACLSourceContactDeleted($version): void { @@ -895,7 +887,6 @@ public function testGetActivityACLSourceContactDeleted($version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testActivitiesGetMultipleIdsCheckPermissions(int $version): void { @@ -925,7 +916,6 @@ public function testActivitiesGetMultipleIdsCheckPermissions(int $version): void * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testActivitiesGetMultipleIdsCheckPermissionsLimitedACL(int $version): void { @@ -965,7 +955,6 @@ public function testActivitiesGetMultipleIdsCheckPermissionsLimitedACL(int $vers * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testActivitiesGetMultipleIdsCheckPermissionsNotIN(int $version): void { @@ -1104,7 +1093,7 @@ public function testContactGetViaJoin(int $version): void { } /** - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testApi4CustomEntityACL(): void { $group = 'test_group'; diff --git a/tests/phpunit/api/v3/APITest.php b/tests/phpunit/api/v3/APITest.php index 3d72c2da769d..f091f5006a59 100644 --- a/tests/phpunit/api/v3/APITest.php +++ b/tests/phpunit/api/v3/APITest.php @@ -141,7 +141,7 @@ public function testV3WrapperException() { try { civicrm_api3('contact', 'create', ['debug' => 1]); } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { $this->assertEquals('mandatory_missing', $e->getErrorCode()); $this->assertEquals('Mandatory key(s) missing from params array: contact_type', $e->getMessage()); $extra = $e->getExtraParams(); diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index e219d71fe485..5f5bbf82e543 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -1011,7 +1011,6 @@ public function testActivityUpdateWithIncorrectContactActivityType() { * contacts in apiv3 style. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testActivityUpdate(): void { $result = $this->callAPISuccess('activity', 'create', $this->_params); diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index b6338be2dafc..ecc0d3705356 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -178,7 +178,6 @@ public function testCreateIndividualNoCacheClear(): void { * * Bool to see if we should check charset. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -588,7 +587,6 @@ public function testCreateNoNameOrganization(): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * * @dataProvider versionThreeAndFour */ @@ -995,7 +993,6 @@ public function testGetSort(): void { * Test the like operator works for Contact.get * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetEmailLike(): void { $this->individualCreate(); @@ -1230,7 +1227,6 @@ public function testGetBetweenZeroWorks(int $version): void { * V3 only - the "skip_greeting_processing" param is not currently in v4 * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetByAddresseeID(): void { $individual1ID = $this->individualCreate([ @@ -1291,9 +1287,7 @@ public function testGetWithCustom(): void { * * https://lab.civicrm.org/dev/core/issues/1025 * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetWithCustomOfActivityType(): void { $this->createCustomGroupWithFieldOfType(['extends' => 'Activity']); @@ -1331,7 +1325,6 @@ public function testGetWithCustomReturnSyntax(): void { * Check that address name, ID is returned if required. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetReturnAddress(): void { $contactID = $this->individualCreate(); @@ -1588,7 +1581,6 @@ public function testDirectionChainingRelationshipsCRM16084(int $version): void { * names and email succeeds. * * @throws \CRM_Core_Exception - * @throws \CRM_Core_Exception */ public function testCreateIndividualWithNameEmail(): void { $params = [ @@ -1671,7 +1663,6 @@ public function testCreateIndividualWithOutNameEmail(): void { * type succeeds. * * @throws \CRM_Core_Exception - * @throws \CRM_Core_Exception */ public function testCreateIndividualWithNameEmailLocationType(): void { $params = [ @@ -1691,7 +1682,6 @@ public function testCreateIndividualWithNameEmailLocationType(): void { * inactive. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateIndividualWithEmployer(): void { $employer = $this->organizationCreate(); @@ -1770,7 +1760,6 @@ public function testCreateHouseholdInadequateDetails(): void { * Verify successful update of individual contact. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testUpdateIndividualWithAll(): void { $contactID = $this->individualCreate(); @@ -1826,9 +1815,7 @@ public function testUpdateOrganizationWithAll(): void { * * CRM-20421: This test make sure that inherited memberships are deleted upon merging organization. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMergeOrganizations(): void { @@ -1876,10 +1863,8 @@ public function testMergeOrganizations(): void { /** * Test the function that determines if 2 contacts have conflicts. * - * @throws \API_Exception - * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testMergeGetConflicts(): void { [$contact1, $contact2] = $this->createDeeplyConflictedContacts(); @@ -1951,9 +1936,7 @@ public function testMergeGetConflicts(): void { /** * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetConflictsAggressiveMode(): void { [$contact1, $contact2] = $this->createDeeplyConflictedContacts(); @@ -2034,7 +2017,6 @@ public function testUpdateHouseholdWithAll(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testUpdateCreateWithID(int $version): void { @@ -2080,7 +2062,7 @@ public function testContactDeleteError(int $version): void { * * @param int $version * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @dataProvider versionThreeAndFour */ public function testContactDelete(int $version): void { @@ -2175,7 +2157,6 @@ public function testContactGetReturnFirstLastNoComma(int $version): void { * Test civicrm_contact_get() with default return properties. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetRetDefault(): void { $contactID = $this->individualCreate(); @@ -2192,7 +2173,6 @@ public function testContactGetRetDefault(): void { * Test civicrm_contact_getquick() with empty name param. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetQuick(): void { $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact', 'email' => 'TestContact@example.com']); @@ -2226,7 +2206,6 @@ public function testContactGetEmptyParams(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetOldParamsNoMatches(int $version): void { @@ -2240,7 +2219,6 @@ public function testContactGetOldParamsNoMatches(int $version): void { * Test civicrm_contact_get(,true) with one match. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetOldParamsOneMatch(): void { $contactID = $this->individualCreate(['first_name' => 'Test', 'last_name' => 'Contact']); @@ -2254,7 +2232,6 @@ public function testContactGetOldParamsOneMatch(): void { * Test civicrm_contact_get(,true) with space in sort_name. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetSpaceMatches(): void { $contactParams_1 = [ @@ -2518,7 +2495,6 @@ public function testContactGetDeceasedDate(): void { * Test for Contact.get id=@user:username. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetByUsername(): void { // Setup - create contact with a uf-match. @@ -2563,7 +2539,6 @@ public function testContactGetByUsername(): void { * Test to check return works OK. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetReturnValues(): void { $extraParams = [ @@ -2981,7 +2956,6 @@ public function testChainingValuesCreate(): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetFormatIsSuccessTrue(int $version): void { @@ -3043,7 +3017,6 @@ public function testContactCreateLongDisplayName(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testCreateAlterSortName(int $version): void { @@ -3082,7 +3055,6 @@ public function killTheJusticeLeague($op, $entity, $id, &$params): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetSingleEntityArray(int $version): void { @@ -3103,7 +3075,6 @@ public function testContactGetSingleEntityArray(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetFormatCountOnly(int $version): void { @@ -3124,7 +3095,6 @@ public function testContactGetFormatCountOnly(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetFormatIDOnly(int $version): void { @@ -3146,7 +3116,6 @@ public function testContactGetFormatIDOnly(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testContactGetFormatSingleValue(int $version): void { @@ -3265,7 +3234,6 @@ public function testContactUpdatePermissions(int $version): void { * Test contact proximity api. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactProximity(): void { // first create a contact with a SF location with a specific @@ -3422,7 +3390,6 @@ public function getSearchSortOptions(): array { * Test that getquick returns contacts with an exact first name match first. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetQuickEmail(): void { $this->getQuickSearchSampleData(); @@ -3463,7 +3430,6 @@ public function testGetQuickEmail(): void { * Test that getquick returns contacts with an exact first name match first. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetQuickEmailACL(): void { $this->getQuickSearchSampleData(); @@ -3639,7 +3605,6 @@ public function testGetQuickFirstName(): void { * Test that getquick applies ACLs. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetQuickFirstNameACLs(): void { $this->getQuickSearchSampleData(); @@ -3900,7 +3865,6 @@ public function testGetReferenceCounts(): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testSQLOperatorsOnContactAPI(int $version): void { @@ -3920,7 +3884,6 @@ public function testSQLOperatorsOnContactAPI(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetModifiedDateByOperators(int $version): void { @@ -3947,7 +3910,6 @@ public function testGetModifiedDateByOperators(int $version): void { * @param int $version * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionThreeAndFour */ public function testGetCreatedDateByOperators(int $version): void { @@ -3972,7 +3934,6 @@ public function testGetCreatedDateByOperators(int $version): void { * CRM-14263 check that API is not affected by search profile related bug. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testReturnCityProfile(): void { $contactID = $this->individualCreate(); @@ -3990,7 +3951,6 @@ public function testReturnCityProfile(): void { * CRM-15443 - ensure getlist api does not return deleted contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testGetlistExcludeConditions(): void { $name = 'Scarabée'; @@ -4082,7 +4042,6 @@ public function testDuplicateCheck(): void { * @param string $phoneKey * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider getPhoneStrings * */ @@ -4201,7 +4160,6 @@ public function testGetByContactType(): void { * This test protects that legacy. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeBizarreOldParams(): void { $this->createLoggedInUser(); @@ -4219,7 +4177,6 @@ public function testMergeBizarreOldParams(): void { * Test merging 2 contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMerge(): void { $this->createLoggedInUser(); @@ -4257,7 +4214,6 @@ public function testMerge(): void { * @param bool $isReverse * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeWithBlankLocationData(bool $isReverse): void { $this->createLoggedInUser(); @@ -4286,9 +4242,7 @@ public function testMergeWithBlankLocationData(bool $isReverse): void { /** * Test merging 2 contacts with custom fields. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMergeCustomFields(): void { @@ -4349,9 +4303,7 @@ public function testMergeCustomFields(): void { /** * Test merging a contact that is the target of a contact reference field on another contact. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeContactReferenceCustomFieldTarget(): void { $this->createCustomGroupWithFieldOfType([], 'contact_reference'); @@ -4369,9 +4321,7 @@ public function testMergeContactReferenceCustomFieldTarget(): void { /** * Test merging a contact that is the target of a contact reference field on another contact. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeMultiContactReferenceCustomFieldTarget(): void { $this->createCustomGroupWithFieldOfType([], 'contact_reference', NULL, ['serialize' => 1]); @@ -4395,9 +4345,7 @@ public function testMergeMultiContactReferenceCustomFieldTarget(): void { /** * Test merging when a multiple record set is in use. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testMergeMultipleCustomValues(): void { @@ -4423,7 +4371,6 @@ public function testMergeMultipleCustomValues(): void { * The goal here is to start with a contact deleted by merged and find out the contact that is the current version of them. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergedGet(): void { $this->contactIDs[] = $this->individualCreate(); @@ -4458,7 +4405,6 @@ public function testMergedGet(): void { * The goal here is to start with a contact deleted by merged and find out the contact that is the current version of them. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergedGetWithPermanentlyDeletedContact(): void { $this->contactIDs[] = $this->individualCreate(); @@ -4485,7 +4431,6 @@ public function testMergedGetWithPermanentlyDeletedContact(): void { * * @see https://issues.civicrm.org/jira/browse/CRM-18307 * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeNoTrash(): void { $this->createLoggedInUser(); @@ -4743,7 +4688,6 @@ public function testContactGetWithGroupTitleMultipleGroupsLegacyFormat(): void { * accessible via the api. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContactGetProximity(): void { CRM_Core_Config::singleton()->geocodeMethod = 'CRM_Utils_MockGeocoder'; @@ -4768,7 +4712,7 @@ public function testContactGetProximity(): void { } /** - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testLoggedInUserAPISupportToken(): void { $description = 'Get contact id of the current logged in user'; @@ -4817,7 +4761,6 @@ public function testCreateCommunicationStyleUnset(int $version): void { * CRM-21041 Test if 'communication style' is set if value is passed. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateCommunicationStylePassed(): void { $this->callAPISuccess('Contact', 'create', [ @@ -4975,7 +4918,6 @@ public function testContactGetFromGroup(): void { * Test the related contacts filter. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSmartGroupsForRelatedContacts(): void { $relationshipType1 = $this->callAPISuccess('RelationshipType', 'create', [ @@ -5044,7 +4986,6 @@ public function testSmartGroupsForRelatedContacts(): void { * Test creating a note from the contact.create API call when only passing the note as a string. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateNoteInCreate(): void { $loggedInContactID = $this->createLoggedInUser(); @@ -5144,9 +5085,7 @@ public function testContactGetWithTag(): void { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createDeeplyConflictedContacts(): array { $this->createCustomGroupWithFieldOfType(); @@ -5198,7 +5137,6 @@ public function versionAndPrivacyOption(): array { * @param $expected * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @dataProvider versionAndPrivacyOption */ public function testGetContactsByPrivacyFlag(int $version, $query, $field, $expected): void { @@ -5264,7 +5202,7 @@ public function testEmojiInWhereClause(): void { * @param int|null $contactID * @param array|null $criteria * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function validateContactField(string $fieldName, $expected, ?int $contactID, array $criteria = NULL): void { diff --git a/tests/phpunit/api/v3/ContributionPageTest.php b/tests/phpunit/api/v3/ContributionPageTest.php index 952443e07a57..4d96ab494df1 100644 --- a/tests/phpunit/api/v3/ContributionPageTest.php +++ b/tests/phpunit/api/v3/ContributionPageTest.php @@ -80,9 +80,7 @@ public function setUp(): void { /** * Tear down after test. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { foreach ($this->contactIds as $id) { @@ -256,7 +254,6 @@ public function testSubmitNewBillingNameDoNotOverwrite(): void { * * @see https://issues.civicrm.org/jira/browse/CRM-16923 * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testSubmitRecurMultiProcessorInstantPayment(): void { @@ -312,9 +309,7 @@ public function testSubmitRecurMultiProcessorInstantPayment(): void { /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockNotSeparatePayment(): void { @@ -336,9 +331,7 @@ public function testSubmitMembershipBlockNotSeparatePayment(): void { /** * Test submit with a membership block in place works with renewal. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockNotSeparatePaymentProcessorInstantRenew(): void { @@ -373,9 +366,7 @@ public function testSubmitMembershipBlockNotSeparatePaymentProcessorInstantRenew /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockNotSeparatePaymentWithEmail(): void { @@ -413,9 +404,7 @@ public function testSubmitMembershipBlockNotSeparatePaymentWithEmail(): void { /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitMembershipBlockNotSeparatePaymentZeroDollarsWithEmail(): void { $mut = new CiviMailUtils($this, TRUE); @@ -452,9 +441,7 @@ public function testSubmitMembershipBlockNotSeparatePaymentZeroDollarsWithEmail( /** * Test submit with a pay later and check line item in mails. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePaymentPayLaterWithEmail(): void { @@ -485,9 +472,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentPayLaterWithEmail(): v /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePayment(): void { @@ -500,9 +485,7 @@ public function testSubmitMembershipBlockIsSeparatePayment(): void { /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePaymentWithPayLater(): void { @@ -538,9 +521,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentWithPayLater(): void { /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePaymentWithEmail(): void { @@ -570,9 +551,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentWithEmail(): void { /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePaymentZeroDollarsPayLaterWithEmail(): void { @@ -601,9 +580,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentZeroDollarsPayLaterWit /** * Test submit with a membership block in place. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockTwoTypesIsSeparatePayment(): void { @@ -632,9 +609,7 @@ public function testSubmitMembershipBlockTwoTypesIsSeparatePayment(): void { * * We are expecting a separate payment for the membership vs the contribution. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipBlockIsSeparatePaymentPaymentProcessorNow(): void { @@ -680,9 +655,7 @@ public function testSubmitMembershipBlockIsSeparatePaymentPaymentProcessorNow(): * @param string $thousandSeparator * punctuation used to refer to thousands. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException * @dataProvider getThousandSeparators */ @@ -783,9 +756,7 @@ public function testSubmitPaymentProcessorFailure(): void { * - the first creates a new membership, completed contribution, in progress recurring. Check these * - create another - end date should be extended * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPaymentYear(): void { @@ -800,9 +771,7 @@ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantP * - the first creates a new membership, completed contribution, in progress recurring. Check these * - create another - end date should be extended * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPaymentMonth(): void { @@ -826,9 +795,7 @@ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantP * * @param array $params * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function doSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPayment(array $params = []): void { @@ -906,9 +873,7 @@ public function doSubmitMembershipPriceSetPaymentPaymentProcessorRecurInstantPay * - the first creates a new membership, completed contribution, in progress recurring. Check these * - create another - end date should be extended * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipComplexQuickConfigPaymentPaymentProcessorRecurInstantPayment(): void { @@ -959,7 +924,6 @@ public function testSubmitMembershipComplexQuickConfigPaymentPaymentProcessorRec * - create another - end date should be extended * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitMembershipComplexPriceSetPaymentPaymentProcessorRecurInstantPayment(): void { $this->params['is_recur'] = 1; @@ -1023,7 +987,6 @@ public function testSubmitMembershipComplexPriceSetPaymentPaymentProcessorRecurI * Extend the price set with a second organisation's membership. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function addSecondOrganizationMembershipToPriceSet(): void { $organization2ID = $this->organizationCreate(); @@ -1078,9 +1041,7 @@ public function addSecondOrganizationMembershipToPriceSet(): void { * - the first creates a new membership, completed contribution, in progress recurring. Check these * - create another - end date should be extended * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipPriceSetPaymentPaymentProcessorSeparatePaymentRecurInstantPayment(): void { @@ -1134,9 +1095,7 @@ public function hookCheckRecurID($paymentObj, $rawParams, $cookedParams): void { * - complete the transaction * - create another - end date should NOT be extended * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed(): void { @@ -1216,9 +1175,7 @@ public function testSubmitMembershipPriceSetPaymentPaymentProcessorRecurDelayed( /** * Test non-recur contribution with membership payment * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSubmitMembershipIsSeparatePaymentNotRecur(): void { @@ -1242,9 +1199,7 @@ public function testSubmitMembershipIsSeparatePaymentNotRecur(): void { * @param array $membershipTypeParams Parameters to pass to * MembershipType.create API * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function setUpMembershipContributionPage(bool $isSeparatePayment = FALSE, bool $isRecur = FALSE, array $membershipTypeParams = []): void { @@ -1748,7 +1703,6 @@ public function addPriceFields(array &$params): void { * @param string $thousandSeparator * punctuation used to refer to thousands. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @dataProvider getThousandSeparators */ @@ -2019,7 +1973,6 @@ private function validateSeparateMembershipPaymentContributions(int $contributio * Membership * * @throws \CRM_Core_Exception - * @throws \API_Exception */ private function validateContributionWithContributionAndMembershipLineItems(int $id, int $preExistingMembershipID): array { $lines = $this->callAPISuccess('line_item', 'get', [ diff --git a/tests/phpunit/api/v3/ContributionTest.php b/tests/phpunit/api/v3/ContributionTest.php index 55e61b01d844..547e7f472dd8 100644 --- a/tests/phpunit/api/v3/ContributionTest.php +++ b/tests/phpunit/api/v3/ContributionTest.php @@ -120,7 +120,6 @@ public function setUp(): void { /** * Clean up after each test. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function tearDown(): void { @@ -1161,7 +1160,6 @@ public function testCreateContributionWithFee() { * contribution is created. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreateContributionOnline(): void { CRM_Financial_BAO_PaymentProcessor::create($this->_processorParams); @@ -2127,7 +2125,6 @@ public function testCompleteTransactionEuro(): void { * Test to ensure mail is sent for pay later * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function testPayLater(): void { $mut = new CiviMailUtils($this, TRUE); @@ -2262,7 +2259,6 @@ public function testCompleteTransactionFeeAmount() { * @param string $thousandSeparator * punctuation used to refer to thousands. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @dataProvider getThousandSeparators */ @@ -2342,7 +2338,6 @@ public function testRepeatTransaction(): void { * (Over time various discussions have deemed this to be the most recent one, allowing * users to alter custom data going forwards. This is implemented for line items already. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testRepeatTransactionWithCustomData(): void { @@ -2688,7 +2683,7 @@ public function testRepeatTransactionMembershipRenewContributionNotCompleted($co * FIXME: buildOptions seems to die in CRM_Core_Config::_construct when in test mode. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function contributionStatusProvider() { $contributionStatuses = civicrm_api3('OptionValue', 'get', [ @@ -2840,7 +2835,7 @@ public function testRepeatTransactionPassedInFinancialType() { /** * Test Contribution with Order api. * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testContributionOrder() { $this->createContributionAndMembershipOrder(); @@ -3194,7 +3189,6 @@ public function testCompleteTransactionForRecurring() { * * If passed in it will override the default from contribution page. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testCompleteTransactionWithEmailReceiptInputTrue(): void { @@ -3418,7 +3412,7 @@ public function testCompleteTransactionUpdatePledgePayment(): void { /** * Test repeating a pledge with the repeatTransaction api.. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testRepeatTransactionWithPledgePayment(): void { $contributionID = $this->createPendingPledgeContribution(2); @@ -3505,7 +3499,7 @@ public function testCompleteTransactionWithParticipantRecord(): void { /** * Test membership is renewed when transaction completed. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testCompleteTransactionMembershipPriceSet(): void { $this->createPriceSetWithPage('membership'); @@ -3541,7 +3535,7 @@ public function testCompleteTransactionMembershipPriceSet(): void { * Test if renewal activity is create after changing Pending contribution to * Completed via offline * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testPendingToCompleteContribution(): void { $this->createPriceSetWithPage('membership'); @@ -3761,7 +3755,6 @@ public function testSendMail(): void { * This simulates webform_civicrm using pay later contribution page * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSendConfirmationPayLater(): void { $mut = new CiviMailUtils($this, TRUE); @@ -4847,7 +4840,6 @@ public function testGetCurrencyOptions() { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -4896,7 +4888,6 @@ public function civicrmPostContributionCustom(string $op, string $objectName, ?i * * @see dev/core#1816 * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testCustomValueOptionLabelTest(): void { @@ -5155,7 +5146,6 @@ public function testCleanMoney() { * * @return int * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/tests/phpunit/api/v3/CustomFieldTest.php b/tests/phpunit/api/v3/CustomFieldTest.php index 7ea591384a16..8fc395b7fe06 100644 --- a/tests/phpunit/api/v3/CustomFieldTest.php +++ b/tests/phpunit/api/v3/CustomFieldTest.php @@ -266,7 +266,7 @@ public function testCustomFieldExistingOptionGroup() { * * (this was happening due to a check running despite no existing option_group_id) * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testUpdateCustomFieldAddOptionGroup() { $customGroup = $this->customGroupCreate(['extends' => 'Organization', 'title' => 'test_group']); @@ -563,7 +563,6 @@ public function testUpdateCustomField() { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testCustomFieldCreateWithOptionGroupName(): void { diff --git a/tests/phpunit/api/v3/CustomValueTest.php b/tests/phpunit/api/v3/CustomValueTest.php index 8f0f3da95e61..fe426d77617a 100644 --- a/tests/phpunit/api/v3/CustomValueTest.php +++ b/tests/phpunit/api/v3/CustomValueTest.php @@ -338,7 +338,7 @@ public function _testCustomValue($customField, $sqlOps, $type) { * * @link https://issues.civicrm.org/jira/browse/CRM-11856 * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testAlterOptionValue() { $this->_populateOptionAndCustomGroup('string'); diff --git a/tests/phpunit/api/v3/EntityBatchTest.php b/tests/phpunit/api/v3/EntityBatchTest.php index 04402fe9841c..58b34040c05a 100644 --- a/tests/phpunit/api/v3/EntityBatchTest.php +++ b/tests/phpunit/api/v3/EntityBatchTest.php @@ -23,7 +23,6 @@ class api_v3_EntityBatchTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); diff --git a/tests/phpunit/api/v3/GroupContactTest.php b/tests/phpunit/api/v3/GroupContactTest.php index 54ebf630d31a..e98eb5f32cda 100644 --- a/tests/phpunit/api/v3/GroupContactTest.php +++ b/tests/phpunit/api/v3/GroupContactTest.php @@ -208,7 +208,7 @@ public function testDeleteAndReAddWithId() { * @param int $version * * @dataProvider versionThreeAndFour - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testDeleteWithPending(int $version): void { $this->_apiversion = $version; diff --git a/tests/phpunit/api/v3/JobTest.php b/tests/phpunit/api/v3/JobTest.php index 6d5319a4f7ca..e9db625dfe76 100644 --- a/tests/phpunit/api/v3/JobTest.php +++ b/tests/phpunit/api/v3/JobTest.php @@ -185,7 +185,7 @@ public function testDelete(): void { * Note that this test is about testing the metadata / calling of the * function & doesn't test the success of the called function * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testCallUpdateGreetingSuccess(): void { $contactID = $this->individualCreate(); @@ -227,7 +227,6 @@ public function testCallUpdateGreetingCommaSeparatedParamsSuccess(): void { * with the job wrapper being respected for legacy functions * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCallSendReminderSuccessMoreThanDefaultLimit(): void { $membershipTypeID = $this->membershipTypeCreate(); @@ -266,7 +265,6 @@ public function testCallSendReminderSuccessMoreThanDefaultLimit(): void { * & check that only the chosen one got the reminder * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCallSendReminderLimitToSMS(): void { [$membershipTypeID, $groupID, $theChosenOneID, $provider] = $this->setUpMembershipSMSReminders(); @@ -297,7 +295,6 @@ public function testCallSendReminderLimitToSMS(): void { * Test disabling expired relationships. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCallDisableExpiredRelationships(): void { $individualID = $this->individualCreate(); @@ -327,7 +324,6 @@ public function testCallDisableExpiredRelationships(): void { * Event templates should not send reminders to additional contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testTemplateRemindAdditionalContacts(): void { $contactId = $this->individualCreate(); @@ -362,7 +358,6 @@ public function testTemplateRemindAdditionalContacts(): void { * Deleted events should not send reminders to additional contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeletedEventRemindAdditionalContacts(): void { $contactId = $this->individualCreate(); @@ -403,7 +398,6 @@ public function testDeletedEventRemindAdditionalContacts(): void { * Also check no hard fail on cron job with running a reminder that has a deleted SMS provider * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCallSendReminderLimitToSMSWithDeletedProvider(): void { [$membershipTypeID, $groupID, $theChosenOneID, $provider] = $this->setUpMembershipSMSReminders(); @@ -484,7 +478,6 @@ public function testBatchMergeWorks($dataSet): void { * Note the group combinations & expected results: * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeWithAssets(): void { $contactID = $this->individualCreate(); @@ -523,7 +516,6 @@ public function testBatchMergeWithAssets(): void { * Test that non-contact entity tags are untouched in merge. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContributionEntityTag(): void { $this->callAPISuccess('OptionValue', 'create', ['option_group_id' => 'tag_used_for', 'value' => 'civicrm_contribution', 'label' => 'Contribution']); @@ -558,7 +550,6 @@ public function testContributionEntityTag(): void { * The ones with **** are the ones where I think a case could be made to change the behaviour. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeMergesGroups(): void { $contactID = $this->individualCreate(); @@ -649,7 +640,6 @@ public function testBatchMergeMergesGroups(): void { * Test that we handle cache entries without clashes. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testMergeCaches(): void { $contactID = $this->individualCreate(); @@ -667,7 +657,7 @@ public function testMergeCaches(): void { /** * Test that we handle cache entries without clashes. * - * @throws \CiviCRM_API3_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception */ public function testMergeSharedActivity(): void { $contactID = $this->individualCreate(); @@ -707,7 +697,6 @@ public function testMergeSharedActivity(): void { * @param array $dataSet * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergesAddresses(array $dataSet): void { $contactID1 = $this->individualCreate(); @@ -744,7 +733,6 @@ public function testBatchMergesAddresses(array $dataSet): void { * @param array $dataSet * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergesAddressesHook(array $dataSet): void { $contactID1 = $this->individualCreate(); @@ -900,7 +888,6 @@ public function getMergeLocationData(): array { * Test weird characters don't mess with merge & cause a fatal. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testNoErrorOnOdd(): void { $this->individualCreate(); @@ -920,7 +907,6 @@ public function testNoErrorOnOdd(): void { * emails. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeEmailHandling(): void { for ($x = 0; $x <= 4; $x++) { @@ -954,7 +940,6 @@ public function testBatchMergeEmailHandling(): void { * @param string|null $conflictText * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeEmailOnHold($onHold1, $onHold2, bool $merge, ?string $conflictText): void { $this->individualCreate([ @@ -1052,7 +1037,6 @@ public function getRuleSets(): array { * emails. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeMatchingAddress(): void { for ($x = 0; $x <= 2; $x++) { @@ -1107,7 +1091,6 @@ public function testBatchMergeMatchingAddress(): void { * We have 2 sets of 5 matches & set the merge only to merge the lower set. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeIDRange(): void { for ($x = 0; $x <= 4; $x++) { @@ -1141,7 +1124,6 @@ public function testBatchMergeIDRange(): void { * Test the batch merge copes with view only custom data field. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeCustomDataViewOnlyField(): void { CRM_Core_Config::singleton()->userPermissionClass->permissions = ['access CiviCRM', 'edit my contact']; @@ -1166,7 +1148,6 @@ public function testBatchMergeCustomDataViewOnlyField(): void { * both merged & mergee fields are respected. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeCustomDataZeroValueField(): void { $customGroup = $this->customGroupCreate(); @@ -1194,7 +1175,6 @@ public function testBatchMergeCustomDataZeroValueField(): void { * Test the batch merge treats 0 vs 1 as a conflict. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testBatchMergeCustomDataZeroValueFieldWithConflict(): void { $customGroup = $this->customGroupCreate(); @@ -2024,7 +2004,6 @@ public function getMergeLocations(array $locationParams1, array $locationParams2 * Test processing membership for deceased contacts. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProcessMembershipDeceased(): void { $this->callAPISuccess('Job', 'process_membership', []); @@ -2041,7 +2020,6 @@ public function testProcessMembershipDeceased(): void { * Test we get an error is deceased status is disabled. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProcessMembershipNoDeceasedStatus(): void { $deceasedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Member_BAO_Membership', 'status_id', 'Deceased'); @@ -2061,7 +2039,6 @@ public function testProcessMembershipNoDeceasedStatus(): void { * and left alone when it shouldn't. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProcessMembershipUpdateStatus(): void { $this->ids['MembershipType'] = $this->membershipTypeCreate(); @@ -2194,7 +2171,7 @@ public function testProcessMembershipUpdateStatus(): void { /** * Test processing membership where is_override is set to 0 rather than NULL * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testProcessMembershipIsOverrideNotNullNot1either(): void { $membershipTypeId = $this->membershipTypeCreate(); @@ -2249,7 +2226,6 @@ protected function assertMembershipStatus(string $expectedStatusName, int $actua * @return int * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function createMembershipNeedingStatusProcessing(string $startDate, string $endDate, string $status, bool $isAdminOverride = FALSE): int { $params = [ @@ -2278,7 +2254,6 @@ protected function createMembershipNeedingStatusProcessing(string $startDate, st * @return array * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function setUpMembershipSMSReminders(): array { $membershipTypeID = $this->membershipTypeCreate(); @@ -2335,7 +2310,6 @@ protected function setUpMembershipSMSReminders(): array { * the email was sent and it more or less looks like an email we'd expect. * * @throws \CRM_Core_Exception - * @throws \CRM_Core_Exception */ public function testMailReportForPrint(): void { $mut = new CiviMailUtils($this, TRUE); diff --git a/tests/phpunit/api/v3/LineItemTest.php b/tests/phpunit/api/v3/LineItemTest.php index 75c34d078765..2f3d10ea4266 100644 --- a/tests/phpunit/api/v3/LineItemTest.php +++ b/tests/phpunit/api/v3/LineItemTest.php @@ -30,7 +30,6 @@ class api_v3_LineItemTest extends CiviUnitTestCase { * Prepare for test. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); diff --git a/tests/phpunit/api/v3/LoggingTest.php b/tests/phpunit/api/v3/LoggingTest.php index 0ada75eac836..38497060e36e 100644 --- a/tests/phpunit/api/v3/LoggingTest.php +++ b/tests/phpunit/api/v3/LoggingTest.php @@ -30,9 +30,7 @@ protected function setUp(): void { /** * Clean up log tables. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ protected function tearDown(): void { $this->quickCleanup(['civicrm_email', 'civicrm_address']); diff --git a/tests/phpunit/api/v3/MailingTest.php b/tests/phpunit/api/v3/MailingTest.php index 6c2cff8267b1..e0c6f33d8f8d 100644 --- a/tests/phpunit/api/v3/MailingTest.php +++ b/tests/phpunit/api/v3/MailingTest.php @@ -694,7 +694,6 @@ public function testMailerSubmit($useLogin, array $createParams, $submitParams, * Test unsubscribe list contains correct groups * when include = 'previous mailing' * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testUnsubscribeGroupList() { diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 0788f96b40e9..d0b2685c0bd0 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -722,7 +722,6 @@ public function testCreateWithRelationship() { * This add a test for https://issues.civicrm.org/jira/browse/CRM-4213 in the hope of removing * the buggy fix for that without a resurgence. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -1285,7 +1284,7 @@ public function testEmptyStartEndDateFixedMultiYear() { /** * CRM-18503 - Test membership join date is correctly set for fixed memberships. * - * @throws \CRM_Core_Exception|\CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testMembershipJoinDateFixed() { $memStatus = CRM_Member_PseudoConstant::membershipStatus(); diff --git a/tests/phpunit/api/v3/OptionValueTest.php b/tests/phpunit/api/v3/OptionValueTest.php index 2e532651445b..3af527cc429a 100644 --- a/tests/phpunit/api/v3/OptionValueTest.php +++ b/tests/phpunit/api/v3/OptionValueTest.php @@ -440,7 +440,7 @@ public function testCreateUpdateOptionValueForPaymentInstrument() { 'financial_account_id' => $nonAssetFinancialAccountId, 'id' => $ov['id'], ]); - throw new API_Exception(ts('Should throw error.')); + throw new CRM_Core_Exception(ts('Should throw error.')); } catch (Exception $e) { try { @@ -450,7 +450,7 @@ public function testCreateUpdateOptionValueForPaymentInstrument() { 'entity_id' => $ov['id'], 'financial_account_id' => $nonAssetFinancialAccountId, ]); - throw new API_Exception(ts('Should throw error.')); + throw new CRM_Core_Exception(ts('Should throw error.')); } catch (Exception $e) { $this->checkPaymentMethodFinancialAccountRelationship($ov['id'], $assetFinancialAccountId); diff --git a/tests/phpunit/api/v3/OrderTest.php b/tests/phpunit/api/v3/OrderTest.php index 35564395537f..971cea59d82f 100644 --- a/tests/phpunit/api/v3/OrderTest.php +++ b/tests/phpunit/api/v3/OrderTest.php @@ -45,7 +45,7 @@ class api_v3_OrderTest extends CiviUnitTestCase { /** * Setup function. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); @@ -212,7 +212,7 @@ public function testAddOrder(): void { /** * Test create order api for membership * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testAddOrderForMembership(): void { $membershipType = $this->membershipTypeCreate(); @@ -510,7 +510,6 @@ public function skipStatusCalStillExists() { * Test create order api for participant * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testAddOrderForParticipant(): void { $event = $this->eventCreate(); @@ -892,9 +891,7 @@ public function testCreateWithChainedPayment(): void { /** * Test creating an order with a mixture of taxable & non-taxable. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function testOrderWithMixedTax(): void { $this->enableTaxAndInvoicing(); diff --git a/tests/phpunit/api/v3/ParticipantTest.php b/tests/phpunit/api/v3/ParticipantTest.php index 1e8a3604f0f4..9e1925acf224 100644 --- a/tests/phpunit/api/v3/ParticipantTest.php +++ b/tests/phpunit/api/v3/ParticipantTest.php @@ -607,7 +607,6 @@ public function testCreateParticipantLineItems() { /** * Check with complete array. * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testUpdate(): void { diff --git a/tests/phpunit/api/v3/PaymentTest.php b/tests/phpunit/api/v3/PaymentTest.php index c43b1b2a4a73..446c5822e129 100644 --- a/tests/phpunit/api/v3/PaymentTest.php +++ b/tests/phpunit/api/v3/PaymentTest.php @@ -826,9 +826,7 @@ public function testUpdatePayment(): void { /** * Test that a contribution can be overpaid with the payment api. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testCreatePaymentOverPay(): void { @@ -962,7 +960,6 @@ public function testCreatePaymentIncompletePaymentPartialPayment(): void { * Test create payment api for failed contribution. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreatePaymentOnFailedContribution(): void { $this->createLoggedInUser(); @@ -1086,7 +1083,6 @@ public function createPartialPaymentOnContribution($contributionID, $partialAmou * Test create payment api for pay later contribution with partial payment. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testCreatePaymentPayLaterPartialPayment(): void { $this->createLoggedInUser(); @@ -1147,7 +1143,6 @@ public function testCreatePaymentPayLaterPartialPayment(): void { /** * Test that Payment.create uses the to_account of the payment processor. * - * @throws \CiviCRM_API3_Exception * @throws \CRM_Core_Exception */ public function testPaymentWithProcessorWithOddFinancialAccount(): void { @@ -1249,7 +1244,6 @@ protected function checkPaymentIsValid(int $paymentID, int $contributionID, int * @see https://lab.civicrm.org/dev/financial/-/issues/139 * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testPaymentCreateTrxnIdAndDates(): void { diff --git a/tests/phpunit/api/v3/PaymentTokenTest.php b/tests/phpunit/api/v3/PaymentTokenTest.php index b4a0a97100ad..cb7d1b9a4fe3 100644 --- a/tests/phpunit/api/v3/PaymentTokenTest.php +++ b/tests/phpunit/api/v3/PaymentTokenTest.php @@ -22,7 +22,7 @@ class api_v3_PaymentTokenTest extends CiviUnitTestCase { /** * Setup for class. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { $this->useTransaction(); diff --git a/tests/phpunit/api/v3/ProfileTest.php b/tests/phpunit/api/v3/ProfileTest.php index 30817bcc40fe..0a051c9f9f68 100644 --- a/tests/phpunit/api/v3/ProfileTest.php +++ b/tests/phpunit/api/v3/ProfileTest.php @@ -27,7 +27,7 @@ class api_v3_ProfileTest extends CiviUnitTestCase { /** * Set up for test. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function setUp(): void { parent::setUp(); @@ -42,9 +42,7 @@ public function setUp(): void { /** * Cleanup after test. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $this->quickCleanUpFinancialEntities(); @@ -101,9 +99,7 @@ public function testProfileGet(): void { * * We are checking that there is no error. * - * @throws \API_Exception * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProfileGetWithAddressCustomData(): void { $this->_createIndividualContact(); @@ -192,7 +188,6 @@ public function testProfileGetBillingUseIsBillingLocation(): void { * Test getting multiple profiles, including billing. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProfileGetMultipleHasBillingLocation(): void { $individual = $this->_createIndividualContact(); @@ -420,7 +415,7 @@ public function testProfileSubmitInvalidProfileId(): void { /** * Check with missing required field in profile. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function testProfileSubmitCheckProfileRequired(): void { $profileFieldValues = $this->_createIndividualContact(); @@ -449,7 +444,6 @@ public function testProfileSubmitCheckProfileRequired(): void { * Check with success. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProfileSubmit(): void { $profileFieldValues = $this->_createIndividualContact(); @@ -539,7 +533,6 @@ public function testMembershipGetFieldsOrder(): void { * Check we can submit membership batch profiles (create mode) * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testProfileSubmitMembershipBatch(): void { // @todo - figure out why this doesn't pass validate financials @@ -561,7 +554,6 @@ public function testProfileSubmitMembershipBatch(): void { * Set is deprecated but we need to ensure it still works. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testLegacySet(): void { $profileFieldValues = $this->_createIndividualContact(); @@ -833,7 +825,6 @@ public function testSubmitWithNote(): void { * Check handling a custom greeting. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testSubmitGreetingFields() { $profileFieldValues = $this->_createIndividualContact(); @@ -872,7 +863,7 @@ public function testSubmitGreetingFields() { * @param array $params * * @return mixed - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function _createIndividualContact($params = []) { $contactParams = array_merge([ diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index 6fe9020efa2b..e34a143e3b7f 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -1389,7 +1389,6 @@ public function testRelationshipCreateWithEmployerData(): void { * See https://lab.civicrm.org/dev/core/issues/470 * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDisableExpiredRelationships() { // Step 1: Create a current employer relationship with Org A diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index 3a1437be22d5..03bfc6636a0b 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -140,7 +140,7 @@ public function testReportTemplateSelectWhere($reportID): void { * Get templates suitable for SelectWhere test. * * @return array - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public function getReportTemplatesSupportingSelectWhere() { $allTemplates = self::getReportTemplates(); @@ -379,7 +379,7 @@ public function alterReportVarHook($varType, &$var, &$object) { * Note that the function needs to * be static so cannot use $this->callAPISuccess * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception */ public static function getReportTemplates() { $reportTemplates = []; @@ -560,7 +560,6 @@ public function testLybuntReportWithFYDataOrderByLastYearAmount() { * Name of the template to test. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContributionSummaryWithSmartGroupFilter(string $template): void { $groupID = $this->setUpPopulatedSmartGroup(); @@ -584,7 +583,6 @@ public function testContributionSummaryWithSmartGroupFilter(string $template): v * @param string $template * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testContributionSummaryWithNotINSmartGroupFilter($template): void { $groupID = $this->setUpPopulatedSmartGroup(); @@ -902,7 +900,6 @@ public function testContributionSummaryDateFields(): void { * * @return int * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUpPopulatedSmartGroup(): int { $household1ID = $this->householdCreate(); @@ -1052,7 +1049,6 @@ public function setUpIntersectingGroups() { * Test Deferred Revenue Report. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function testDeferredRevenueReport(): void { $indv1 = $this->individualCreate(); @@ -1112,7 +1108,6 @@ public function testDeferredRevenueReport(): void { * @param string $template * Report template unique identifier. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/tests/phpunit/api/v3/TaxContributionPageTest.php b/tests/phpunit/api/v3/TaxContributionPageTest.php index 8b717ce352f4..801c8fc5316d 100644 --- a/tests/phpunit/api/v3/TaxContributionPageTest.php +++ b/tests/phpunit/api/v3/TaxContributionPageTest.php @@ -36,7 +36,6 @@ class api_v3_TaxContributionPageTest extends CiviUnitTestCase { /** * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function setUp(): void { parent::setUp(); @@ -135,7 +134,6 @@ public function setUp(): void { * Cleanup after function. * * @throws \CRM_Core_Exception - * @throws \CiviCRM_API3_Exception */ public function tearDown(): void { $this->quickCleanUpFinancialEntities(); @@ -188,7 +186,6 @@ public function setUpContributionPage(): void { * @param string $thousandSeparator * punctuation used to refer to thousands. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @dataProvider getThousandSeparators * @@ -275,7 +272,6 @@ public function testCreateContributionChainedLineItems(string $thousandSeparator } /** - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function testCreateContributionPayLaterOnline(): void { @@ -311,7 +307,6 @@ public function testCreateContributionPayLaterOnline(): void { * @param string $thousandSeparator * punctuation used to refer to thousands. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @dataProvider getThousandSeparators @@ -430,7 +425,7 @@ public function _getFinancialItemAmount(int $contId): ?string { * @param array $params * @param string $context * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function _checkFinancialRecords($params, $context): void { $contributionID = $params['id']; @@ -525,7 +520,7 @@ public function testDeleteContribution(): void { * @param $contributionID * * @return \Civi\Api4\Generic\Result - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ protected function getFinancialTransactionsForContribution($contributionID): \Civi\Api4\Generic\Result { diff --git a/tests/phpunit/api/v3/UtilsTest.php b/tests/phpunit/api/v3/UtilsTest.php index 42c57793ba0d..d58760c8595e 100644 --- a/tests/phpunit/api/v3/UtilsTest.php +++ b/tests/phpunit/api/v3/UtilsTest.php @@ -125,7 +125,7 @@ public function testCamelName($inputValue, $expectValue) { * @param bool $throws * Whether we should pass any exceptions for authorization failures. * - * @throws API_Exception + * @throws CRM_Core_Exception * @throws Exception * @return bool * TRUE or FALSE depending on the outcome of the authorization check @@ -140,9 +140,9 @@ public function runPermissionCheck($entity, $action, $params, $throws = FALSE) { $kernel->authorize(NULL, $apiRequest); return TRUE; } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $extra = $e->getExtraParams(); - if (!$throws && $extra['error_code'] == API_Exception::UNAUTHORIZED) { + if (!$throws && $extra['error_code'] == CRM_Core_Exception::UNAUTHORIZED) { return FALSE; } else { @@ -265,7 +265,7 @@ public function testGetBAO() { /** * Test the validate function transforms dates. * - * @throws \CiviCRM_API3_Exception + * @throws \CRM_Core_Exception * @throws \Exception */ public function test_civicrm_api3_validate_fields() { @@ -512,7 +512,6 @@ public function testTimeStampChecking() { * Test that the foreign key constraint test correctly interprets pseudoconstants. * * @throws \CRM_Core_Exception - * @throws \API_Exception */ public function testKeyConstraintCheck() { $fieldInfo = $this->callAPISuccess('Contribution', 'getfields', [])['values']['financial_type_id']; @@ -521,7 +520,7 @@ public function testKeyConstraintCheck() { try { _civicrm_api3_validate_constraint('Blah', 'financial_type_id', $fieldInfo, 'Contribution'); } - catch (API_Exception $e) { + catch (CRM_Core_Exception $e) { $this->assertEquals("'Blah' is not a valid option for field financial_type_id", $e->getMessage()); return; } diff --git a/tests/phpunit/api/v3/custom_api/MailingProviderData.php b/tests/phpunit/api/v3/custom_api/MailingProviderData.php index c1ee467dcdce..61cff1218e5b 100644 --- a/tests/phpunit/api/v3/custom_api/MailingProviderData.php +++ b/tests/phpunit/api/v3/custom_api/MailingProviderData.php @@ -252,7 +252,7 @@ class CRM_Omnimail_BAO_MailingProviderData extends CRM_Omnimail_DAO_MailingProvi * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_mailing_provider_data_get($params) { $sql = CRM_Utils_SQL_Select::fragment(); @@ -265,7 +265,7 @@ function civicrm_api3_mailing_provider_data_get($params) { * * @param array $params * - * @throws API_Exception + * @throws CRM_Core_Exception */ function _civicrm_api3_mailing_provider_data_get_spec(&$params) { $params['mailing_identifier']['FKClassName'] = 'CRM_Mailing_BAO_Mailing'; @@ -278,7 +278,7 @@ function _civicrm_api3_mailing_provider_data_get_spec(&$params) { * * @param array $params * @return array API result descriptor - * @throws API_Exception + * @throws CRM_Core_Exception */ function civicrm_api3_mailing_provider_data_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); diff --git a/tests/phpunit/api/v4/Action/AbstractActionFunctionTest.php b/tests/phpunit/api/v4/Action/AbstractActionFunctionTest.php index 0ff3c8b2b9b3..2b8fb8a38e05 100644 --- a/tests/phpunit/api/v4/Action/AbstractActionFunctionTest.php +++ b/tests/phpunit/api/v4/Action/AbstractActionFunctionTest.php @@ -26,7 +26,7 @@ class AbstractActionFunctionTest extends Api4TestBase { public function testUndefinedParamException(): void { - $this->expectException('API_Exception'); + $this->expectException('CRM_Core_Exception'); $this->expectExceptionMessage('Unknown api parameter: getTranslationMode'); \Civi\Api4\System::flush(FALSE)->getTranslationMode(); } diff --git a/tests/phpunit/api/v4/Action/BasicActionsTest.php b/tests/phpunit/api/v4/Action/BasicActionsTest.php index b7bc554e79f9..f9668e094d0e 100644 --- a/tests/phpunit/api/v4/Action/BasicActionsTest.php +++ b/tests/phpunit/api/v4/Action/BasicActionsTest.php @@ -430,7 +430,7 @@ public function testPseudoconstantMatch() { try { MockBasicEntity::create()->addValue('fruit:color', 'yellow')->execute(); } - catch (\API_Exception $createError) { + catch (\CRM_Core_Exception $createError) { } $this->assertStringContainsString('Illegal expression', $createError->getMessage()); } diff --git a/tests/phpunit/api/v4/Action/ContactGetTest.php b/tests/phpunit/api/v4/Action/ContactGetTest.php index b341ba762b3e..d6ddcbc83f90 100644 --- a/tests/phpunit/api/v4/Action/ContactGetTest.php +++ b/tests/phpunit/api/v4/Action/ContactGetTest.php @@ -95,7 +95,7 @@ public function testGetWithLimit() { try { $limit2->single(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $msg = $e->getMessage(); } $this->assertRegExp(';Expected to find one Contact record;', $msg); @@ -111,7 +111,7 @@ public function testGetWithLimit() { * By default our DBs are not 🦉 compliant. This test will age * out when we are. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testEmoji(): void { $schemaNeedsAlter = \CRM_Core_BAO_SchemaHandler::databaseSupportsUTF8MB4(); @@ -315,7 +315,7 @@ public function testGetWithWhereExpression() { } /** - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testOrClause(): void { Contact::get() diff --git a/tests/phpunit/api/v4/Action/ContactIsDeletedTest.php b/tests/phpunit/api/v4/Action/ContactIsDeletedTest.php index e8aea8f01734..82f92012058c 100644 --- a/tests/phpunit/api/v4/Action/ContactIsDeletedTest.php +++ b/tests/phpunit/api/v4/Action/ContactIsDeletedTest.php @@ -65,7 +65,7 @@ public function testIsDeletedPermission(): void { ]); $this->assertEquals(count($originalQuery), count($isDeletedQuery)); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->fail('An Exception Should not have been raised'); } try { @@ -74,7 +74,7 @@ public function testIsDeletedPermission(): void { 'where' => [['contact_id.first_name', '=', 'phoney'], ['contact_id.is_deleted', '=', 0]], ]); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->fail('An Exception Should not have been raised'); } } diff --git a/tests/phpunit/api/v4/Action/FkJoinTest.php b/tests/phpunit/api/v4/Action/FkJoinTest.php index ef06a766ea5a..b935da136eed 100644 --- a/tests/phpunit/api/v4/Action/FkJoinTest.php +++ b/tests/phpunit/api/v4/Action/FkJoinTest.php @@ -163,7 +163,7 @@ public function testInvalidJoinAlias() { try { Contact::get(FALSE)->addJoin('Address AS a')->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $message = $e->getMessage(); } $this->assertEquals('Illegal join alias: "a"', $message); @@ -172,7 +172,7 @@ public function testInvalidJoinAlias() { try { Contact::get(FALSE)->addJoin('Address AS add.ress')->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $message = $e->getMessage(); } $this->assertEquals('Illegal join alias: "add.ress"', $message); @@ -182,7 +182,7 @@ public function testInvalidJoinAlias() { $longAlias = str_repeat('z', 257); Contact::get(FALSE)->addJoin("Address AS $longAlias")->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $message = $e->getMessage(); } $this->assertEquals("Illegal join alias: \"$longAlias\"", $message); diff --git a/tests/phpunit/api/v4/Action/IndexTest.php b/tests/phpunit/api/v4/Action/IndexTest.php index aa9c507f1061..dbd297e69786 100644 --- a/tests/phpunit/api/v4/Action/IndexTest.php +++ b/tests/phpunit/api/v4/Action/IndexTest.php @@ -45,7 +45,7 @@ public function testBadIndexInt() { try { civicrm_api4('Activity', 'getActions', [], 99); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $error = $e->getMessage(); } $this->assertStringContainsString('not found', $error); @@ -56,7 +56,7 @@ public function testBadIndexString() { try { civicrm_api4('Activity', 'getActions', [], 'xyz'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $error = $e->getMessage(); } $this->assertStringContainsString('not found', $error); diff --git a/tests/phpunit/api/v4/Action/RequiredFieldTest.php b/tests/phpunit/api/v4/Action/RequiredFieldTest.php index f50623c33bde..1bcb2b79a772 100644 --- a/tests/phpunit/api/v4/Action/RequiredFieldTest.php +++ b/tests/phpunit/api/v4/Action/RequiredFieldTest.php @@ -33,7 +33,7 @@ public function testRequired() { try { Event::create()->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $msg = $e->getMessage(); } $this->assertEquals('Mandatory values missing from Api4 Event::create: title, event_type_id, start_date', $msg); diff --git a/tests/phpunit/api/v4/Action/SaveTest.php b/tests/phpunit/api/v4/Action/SaveTest.php index 1f7297bcb5db..71211809f24b 100644 --- a/tests/phpunit/api/v4/Action/SaveTest.php +++ b/tests/phpunit/api/v4/Action/SaveTest.php @@ -31,7 +31,7 @@ class SaveTest extends Api4TestBase implements TransactionalInterface { /** * @dataProvider getMatchingCriteriaDataProvider * @return void - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testSaveWithMatchingCriteria($matchCriteria, $records, $changes, $expected) { diff --git a/tests/phpunit/api/v4/Action/SqlExpressionTest.php b/tests/phpunit/api/v4/Action/SqlExpressionTest.php index f56f833550d0..d93a175ee680 100644 --- a/tests/phpunit/api/v4/Action/SqlExpressionTest.php +++ b/tests/phpunit/api/v4/Action/SqlExpressionTest.php @@ -79,7 +79,7 @@ public function testSelectAlias() { ->addSelect('first_name AS bob') ->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $msg = $e->getMessage(); } $this->assertStringContainsString('alias', $msg); @@ -88,7 +88,7 @@ public function testSelectAlias() { ->addSelect('55 AS sort_name') ->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $msg = $e->getMessage(); } $this->assertStringContainsString('existing field name', $msg); diff --git a/tests/phpunit/api/v4/Action/SqlFunctionTest.php b/tests/phpunit/api/v4/Action/SqlFunctionTest.php index fb7068c18c47..773bb674691a 100644 --- a/tests/phpunit/api/v4/Action/SqlFunctionTest.php +++ b/tests/phpunit/api/v4/Action/SqlFunctionTest.php @@ -221,7 +221,7 @@ public function testIncorrectNumberOfArguments() { ->execute(); $this->fail('Api should have thrown exception'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertEquals('Missing param 2 for SQL function IF', $e->getMessage()); } @@ -231,7 +231,7 @@ public function testIncorrectNumberOfArguments() { ->execute(); $this->fail('Api should have thrown exception'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertEquals('Too many arguments given for SQL function NULLIF', $e->getMessage()); } @@ -241,7 +241,7 @@ public function testIncorrectNumberOfArguments() { ->execute(); $this->fail('Api should have thrown exception'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertEquals('Too few arguments to param 2 for SQL function CONCAT_WS', $e->getMessage()); } } diff --git a/tests/phpunit/api/v4/Custom/BasicCustomFieldTest.php b/tests/phpunit/api/v4/Custom/BasicCustomFieldTest.php index 41137824eea5..5772a7e31220 100644 --- a/tests/phpunit/api/v4/Custom/BasicCustomFieldTest.php +++ b/tests/phpunit/api/v4/Custom/BasicCustomFieldTest.php @@ -32,7 +32,7 @@ class BasicCustomFieldTest extends CustomTestBase { /** - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testWithSingleField(): void { $customGroup = CustomGroup::create(FALSE) @@ -387,7 +387,7 @@ public function testMultipleJoinsToCustomTable() { /** * Some types are creating a dummy option group even if we don't have * any option values. - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testUndesiredOptionGroupCreation(): void { $optionGroupCount = OptionGroup::get(FALSE)->selectRowCount()->execute()->count(); diff --git a/tests/phpunit/api/v4/Custom/CustomGroupACLTest.php b/tests/phpunit/api/v4/Custom/CustomGroupACLTest.php index 2a74f408abdc..2a6c006e4e1a 100644 --- a/tests/phpunit/api/v4/Custom/CustomGroupACLTest.php +++ b/tests/phpunit/api/v4/Custom/CustomGroupACLTest.php @@ -183,7 +183,7 @@ public function testViewEditCustomGroupACLs() { } $this->assertEquals($values, $result->column('MyField')); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { if ($groupName !== 'MySuperSecretMulti') { $this->fail('API get should have succeeded'); } @@ -211,7 +211,7 @@ public function testViewEditCustomGroupACLs() { $this->fail('API call should have failed'); } } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { if ($groupName === 'MyReadWriteMulti') { $this->fail('API create should have succeeded'); } diff --git a/tests/phpunit/api/v4/Custom/CustomTestBase.php b/tests/phpunit/api/v4/Custom/CustomTestBase.php index 98bae9adc915..f52cef1bcb45 100644 --- a/tests/phpunit/api/v4/Custom/CustomTestBase.php +++ b/tests/phpunit/api/v4/Custom/CustomTestBase.php @@ -36,7 +36,7 @@ abstract class CustomTestBase extends Api4TestBase { /** * Delete all created options groups. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function tearDown(): void { $optgroups = CustomField::get(FALSE)->addSelect('option_group_id')->addWhere('option_group_id', 'IS NOT NULL')->execute(); diff --git a/tests/phpunit/api/v4/Custom/CustomValueTest.php b/tests/phpunit/api/v4/Custom/CustomValueTest.php index ffe2f517d00f..3f7fe4fec590 100644 --- a/tests/phpunit/api/v4/Custom/CustomValueTest.php +++ b/tests/phpunit/api/v4/Custom/CustomValueTest.php @@ -273,7 +273,7 @@ public function testCRUD() { /** * Whenever a CustomGroup toggles the `is_multiple` flag, the entity-list should be updated. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testEntityRefresh() { diff --git a/tests/phpunit/api/v4/Entity/ConformanceTest.php b/tests/phpunit/api/v4/Entity/ConformanceTest.php index 773012b4f577..9cdce6f5b1a7 100644 --- a/tests/phpunit/api/v4/Entity/ConformanceTest.php +++ b/tests/phpunit/api/v4/Entity/ConformanceTest.php @@ -54,7 +54,7 @@ public function setUp(): void { } /** - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function tearDown(): void { @@ -82,7 +82,6 @@ public function tearDown(): void { * * @return array * - * @throws \API_Exception * @throws \CRM_Core_Exception */ public function getEntitiesHitech(): array { @@ -136,7 +135,7 @@ public function testEntitiesProvider(): void { * * @dataProvider getEntitiesLotech * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testConformance(string $entity): void { $entityClass = CoreUtil::getApiClass($entity); @@ -187,7 +186,7 @@ protected function checkEntityInfo($entityClass): void { * @param \Civi\Api4\Generic\AbstractEntity|string $entityClass * @param string $entity * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function checkFields($entityClass, $entity) { $fields = $entityClass::getFields(FALSE) @@ -221,7 +220,7 @@ protected function checkFields($entityClass, $entity) { * * @return array * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ protected function checkActions($entityClass): array { $actions = $entityClass::getActions(FALSE) @@ -313,7 +312,7 @@ protected function checkUpdateFailsFromCreate($entityClass, int $id): void { ->addValue('id', $id) ->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $exceptionThrown = $e->getMessage(); } $this->assertStringContainsString('id', $exceptionThrown); @@ -385,7 +384,7 @@ protected function checkDeleteWithNoId($entityClass) { ->execute(); $this->fail("$entityClass should require ID to delete."); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { // OK } } @@ -400,7 +399,7 @@ protected function checkWrongParamType($entityClass) { ->setDebug('not a bool') ->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $exceptionThrown = $e->getMessage(); } $this->assertStringContainsString('debug', $exceptionThrown); diff --git a/tests/phpunit/api/v4/Entity/ExampleDataTest.php b/tests/phpunit/api/v4/Entity/ExampleDataTest.php index ba1f696a599a..2838ed9311cb 100644 --- a/tests/phpunit/api/v4/Entity/ExampleDataTest.php +++ b/tests/phpunit/api/v4/Entity/ExampleDataTest.php @@ -29,7 +29,7 @@ class ExampleDataTest extends Api4TestBase { /** * Basic canary test fetching a specific example. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testGet() { diff --git a/tests/phpunit/api/v4/Entity/ManagedEntityTest.php b/tests/phpunit/api/v4/Entity/ManagedEntityTest.php index 007989be44c3..47105a259301 100644 --- a/tests/phpunit/api/v4/Entity/ManagedEntityTest.php +++ b/tests/phpunit/api/v4/Entity/ManagedEntityTest.php @@ -385,7 +385,7 @@ public function testOptionGroupAndValues(): void { } /** - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testExportOptionGroupWithDomain(): void { $result = OptionGroup::get(FALSE) diff --git a/tests/phpunit/api/v4/Entity/QueueTest.php b/tests/phpunit/api/v4/Entity/QueueTest.php index 3656eb1ff8f5..9fcb94e92458 100644 --- a/tests/phpunit/api/v4/Entity/QueueTest.php +++ b/tests/phpunit/api/v4/Entity/QueueTest.php @@ -47,7 +47,7 @@ protected function setUp(): void { * The first task runs normally. The second task fails at first, but it is retried, and then * succeeds. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testBasicLinearPolling() { @@ -140,7 +140,7 @@ public function testBasicParallelPolling() { * * Batches are executed via `hook_civicrm_queueRun_{runner}`. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testBatchParallelPolling() { @@ -397,7 +397,6 @@ public function testRetryWithEventualFailure(string $errorMode) { * If a queue is created as part of a user-job, then it has a fixed scope-of-work. The status * should flip after completing its work. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ @@ -454,7 +453,6 @@ public function testUserJobQueue_Completion() { /** * If a queue is created as a long-term service, then its work is never complete. * - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ diff --git a/tests/phpunit/api/v4/Entity/SavedSearchTest.php b/tests/phpunit/api/v4/Entity/SavedSearchTest.php index e682900bbb66..92d674d3d296 100644 --- a/tests/phpunit/api/v4/Entity/SavedSearchTest.php +++ b/tests/phpunit/api/v4/Entity/SavedSearchTest.php @@ -30,7 +30,7 @@ class SavedSearchTest extends Api4TestBase implements TransactionalInterface { /** - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ public function testContactSmartGroup(): void { diff --git a/tests/phpunit/api/v4/Entity/SettingTest.php b/tests/phpunit/api/v4/Entity/SettingTest.php index ab804645fd9e..f5f93763156c 100644 --- a/tests/phpunit/api/v4/Entity/SettingTest.php +++ b/tests/phpunit/api/v4/Entity/SettingTest.php @@ -45,7 +45,7 @@ public function testInvalidSetting() { try { Setting::set()->addValue('not_a_real_setting!', 'hello')->setCheckPermissions(FALSE)->execute(); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $message = $e->getMessage(); } $this->assertStringContainsString('setting', $message); diff --git a/tests/phpunit/api/v4/Entity/TranslationTest.php b/tests/phpunit/api/v4/Entity/TranslationTest.php index cd9be2b33c54..9dd2708ae1d6 100644 --- a/tests/phpunit/api/v4/Entity/TranslationTest.php +++ b/tests/phpunit/api/v4/Entity/TranslationTest.php @@ -157,7 +157,7 @@ protected function setUp(): void { * * @param array $record * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testCreateOK(array $record): void { $record = $this->fillRecord($record); @@ -190,7 +190,7 @@ public function testCreateBad(array $record, string $errorRegex): void { ]); $this->fail('Create should have failed'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertRegExp($errorRegex, $e->getMessage()); } } @@ -201,7 +201,7 @@ public function testCreateBad(array $record, string $errorRegex): void { * @param $badUpdate * @param $errorRegex * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ public function testUpdateBad($createRecord, $badUpdate, $errorRegex): void { @@ -220,7 +220,7 @@ public function testUpdateBad($createRecord, $badUpdate, $errorRegex): void { ]); $this->fail('Update should fail'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertRegExp($errorRegex, $e->getMessage()); } } diff --git a/tests/phpunit/api/v4/Entity/ValidateValuesTest.php b/tests/phpunit/api/v4/Entity/ValidateValuesTest.php index 79255599e9f7..c1847c5e802d 100644 --- a/tests/phpunit/api/v4/Entity/ValidateValuesTest.php +++ b/tests/phpunit/api/v4/Entity/ValidateValuesTest.php @@ -46,7 +46,7 @@ public function tearDown(): void { * Fire ValidateValuesEvent several times - and ensure it conveys the * expected data. * - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ public function testHookData() { @@ -160,7 +160,7 @@ public function testRaiseError() { ])->execute(); $this->fail('Expected an exception due to validation error'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertEquals(1, $hookCount); $this->assertRegExp(';not sufficiently namey;', $e->getMessage()); $this->assertRegExp(';tongue twister;', $e->getMessage()); diff --git a/tests/phpunit/api/v4/Entity/WorkflowMessageTest.php b/tests/phpunit/api/v4/Entity/WorkflowMessageTest.php index 304c5f01fcd3..38e82dffbdff 100644 --- a/tests/phpunit/api/v4/Entity/WorkflowMessageTest.php +++ b/tests/phpunit/api/v4/Entity/WorkflowMessageTest.php @@ -32,7 +32,7 @@ class WorkflowMessageTest extends Api4TestBase implements TransactionalInterface /** * Basic get test. * - * @throws \API_Exception + * @throws \CRM_Core_Exception */ public function testGet(): void { $result = WorkflowMessage::get(FALSE) @@ -110,7 +110,7 @@ public function getRenderExamples(): array { * Only examples tagged phpunit will be checked. * * @param string $name - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException * @dataProvider getRenderExamples */ diff --git a/tests/phpunit/api/v4/Options/TranslationModeTest.php b/tests/phpunit/api/v4/Options/TranslationModeTest.php index 6cf7c19e9759..72e9fd7256d4 100644 --- a/tests/phpunit/api/v4/Options/TranslationModeTest.php +++ b/tests/phpunit/api/v4/Options/TranslationModeTest.php @@ -49,7 +49,7 @@ public function getTranslationSettings(): array { * Test that translated strings are rendered for templates where they exist. * * @dataProvider getTranslationSettings - * @throws \API_Exception|\CRM_Core_Exception + * @throws \CRM_Core_Exception * @group locale */ public function testGetTranslatedTemplate($translationSettings): void { @@ -86,7 +86,7 @@ public function testGetTranslatedTemplate($translationSettings): void { /** * @return mixed - * @throws \API_Exception + * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\UnauthorizedException */ private function addTranslation() { diff --git a/tests/phpunit/api/v4/Query/Api4SelectQueryTest.php b/tests/phpunit/api/v4/Query/Api4SelectQueryTest.php index 03f147b62d0d..ada14d805361 100644 --- a/tests/phpunit/api/v4/Query/Api4SelectQueryTest.php +++ b/tests/phpunit/api/v4/Query/Api4SelectQueryTest.php @@ -55,7 +55,6 @@ public function testManyToOneJoin() { } /** - * @throws \API_Exception * @throws \CRM_Core_Exception * @throws \Civi\API\Exception\NotImplementedException */ @@ -89,7 +88,7 @@ public function testInvalidSort(): void { $query->run(); $this->fail('An Exception Should have been raised'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { } $api = Request::create('Contact', 'get', [ @@ -104,7 +103,7 @@ public function testInvalidSort(): void { $query->run(); $this->fail('An Exception Should have been raised'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { } } diff --git a/tests/phpunit/api/v4/Query/SqlExpressionParserTest.php b/tests/phpunit/api/v4/Query/SqlExpressionParserTest.php index afdefcbace8a..9f9e8397e4cf 100644 --- a/tests/phpunit/api/v4/Query/SqlExpressionParserTest.php +++ b/tests/phpunit/api/v4/Query/SqlExpressionParserTest.php @@ -81,7 +81,7 @@ public function testAggregateFuncitons($fnName) { $this->fail('SqlWild should only be allowed in COUNT.'); } } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $this->assertStringContainsString('Illegal', $e->getMessage()); } } diff --git a/tests/phpunit/api/v4/Service/Schema/SchemaMapperTest.php b/tests/phpunit/api/v4/Service/Schema/SchemaMapperTest.php index 46851ad20e4b..e0fd73af9e4c 100644 --- a/tests/phpunit/api/v4/Service/Schema/SchemaMapperTest.php +++ b/tests/phpunit/api/v4/Service/Schema/SchemaMapperTest.php @@ -34,7 +34,7 @@ public function testWillHaveNoPathWithNoTables() { try { $map->getLink('foo', 'bar'); } - catch (\API_Exception $e) { + catch (\CRM_Core_Exception $e) { $exception = $e; } $this->assertStringContainsString('not found', $exception->getMessage()); diff --git a/tests/templates/documentFunction.tpl b/tests/templates/documentFunction.tpl index 1ec1bc5a0d24..5812a47b64f7 100644 --- a/tests/templates/documentFunction.tpl +++ b/tests/templates/documentFunction.tpl @@ -29,7 +29,7 @@ function {$function}_example() {literal}{{/literal} try {{/literal} $result = civicrm_api3('{$entity}', '{$action}', $params); {literal} } - catch (CiviCRM_API3_Exception $e) { + catch (CRM_Core_Exception $e) { // Handle error here. $errorMessage = $e->getMessage(); $errorCode = $e->getErrorCode();