*/ public static function expectedApiExceptionProvider(): iterable { yield CanNotDeleteUserWhoIsOwnerOfOrganizationWithMultipleMembers::class => [new CanNotDeleteUserWhoIsOwnerOfOrganizationWithMultipleMembers]; yield CanNotRemoveOwnerFromOrganization::class => [new CanNotRemoveOwnerFromOrganization]; yield ChangingRoleOfPlaceholderIsNotAllowed::class => [new ChangingRoleOfPlaceholderIsNotAllowed]; yield ChangingRoleToPlaceholderIsNotAllowed::class => [new ChangingRoleToPlaceholderIsNotAllowed]; yield EntityStillInUseApiException::class => [new EntityStillInUseApiException('member', 'time_entry')]; yield FeatureIsNotAvailableInFreePlanApiException::class => [new FeatureIsNotAvailableInFreePlanApiException]; yield InactiveUserCanNotBeUsedApiException::class => [new InactiveUserCanNotBeUsedApiException]; yield InvitationForTheEmailAlreadyExistsApiException::class => [new InvitationForTheEmailAlreadyExistsApiException]; yield OnlyOwnerCanChangeOwnership::class => [new OnlyOwnerCanChangeOwnership]; yield OnlyPlaceholdersCanBeMergedIntoAnotherMember::class => [new OnlyPlaceholdersCanBeMergedIntoAnotherMember]; yield OrganizationHasNoSubscriptionButMultipleMembersException::class => [new OrganizationHasNoSubscriptionButMultipleMembersException]; yield OrganizationNeedsAtLeastOneOwner::class => [new OrganizationNeedsAtLeastOneOwner]; yield OverlappingTimeEntryApiException::class => [new OverlappingTimeEntryApiException]; yield ThisPlaceholderCanNotBeInvitedUseTheMergeToolInsteadException::class => [new ThisPlaceholderCanNotBeInvitedUseTheMergeToolInsteadException]; yield TimeEntryCanNotBeRestartedApiException::class => [new TimeEntryCanNotBeRestartedApiException]; yield TimeEntryStillRunningApiException::class => [new TimeEntryStillRunningApiException]; yield UserIsAlreadyMemberOfOrganizationApiException::class => [new UserIsAlreadyMemberOfOrganizationApiException]; yield UserIsAlreadyMemberOfProjectApiException::class => [new UserIsAlreadyMemberOfProjectApiException]; yield UserNotPlaceholderApiException::class => [new UserNotPlaceholderApiException]; yield UserResendEmailVerificationNoPendingEmailApiException::class => [new UserResendEmailVerificationNoPendingEmailApiException]; } #[DataProvider('expectedApiExceptionProvider')] public function test_expected_api_exceptions_are_not_reported(ApiException $exception): void { // Arrange: exception supplied by the data provider // Act $reportingHandled = $exception->report(); // Assert $this->assertTrue($reportingHandled); } /** * @return iterable */ public static function operationalApiExceptionProvider(): iterable { yield PdfRendererIsNotConfiguredException::class => [new PdfRendererIsNotConfiguredException]; yield PersonalAccessClientIsNotConfiguredException::class => [new PersonalAccessClientIsNotConfiguredException]; yield ExportException::class => [new ExportException]; } #[DataProvider('operationalApiExceptionProvider')] public function test_operational_api_exceptions_are_reported(ApiException $exception): void { // Arrange: exception supplied by the data provider // Act $reportingHandled = $exception->report(); // Assert $this->assertFalse($reportingHandled); } }