Add IM UserStatus service for im.user.status.* methods#462
Merged
Conversation
- Add UserStatusType enum (online/idle/away/dnd/offline) - Add UserStatusResult with status(): string accessor - Add UserStatus service wrapping im.user.status.get, im.user.status.set, im.user.status.idle.start, im.user.status.idle.end - Register IMServiceBuilder::userStatus() accessor - Add unit test for UserStatus and IMServiceBuilderTest::testGetUserStatusService() - Add integration test for all four methods - Add integration_tests_im_user_status suite to phpunit.xml.dist - Add test-integration-im-user-status target to Makefile - Update CHANGELOG.md under 3.2.0 Unreleased → Added https://claude.ai/code/session_015PC3VWnQepqMPssMpMacy6
# Conflicts: # Makefile # phpunit.xml.dist # src/Services/IM/IMServiceBuilder.php # tests/Unit/Services/IM/IMServiceBuilderTest.php
…`UserStatusResult::status()` - Added `UserStatusItemResult` with `STATUS` property backed by `UserStatusType` enum. - Updated `UserStatusResult::status()` to return `UserStatusItemResult` instead of string. - Extended `UserStatusType` enum with new `break` status. - Added unit and integration tests to ensure proper handling of `UserStatusItemResult`. Signed-off-by: mesilov <mesilov.maxim@gmail.com>
…edItem` - Introduced generic support for backed-enum casting in `AbstractAnnotatedItem`. - Removed specialized enum casting logic from `UserStatusItemResult`. - Added unit tests for enum casting behavior with string-backed, int-backed, and nullable enums. - Updated `CHANGELOG.md` to document enum-related improvements in `AbstractAnnotatedItem`. Signed-off-by: mesilov <mesilov.maxim@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a new
UserStatusservice undersrc/Services/IM/User/Service/that wraps four REST API methods for managing user status in Bitrix24:im.user.status.get— retrieves the current user's status (online, idle, away, dnd, offline)im.user.status.set— sets a custom statusim.user.status.idle.start— enables automatic "Away" statusim.user.status.idle.end— disables automatic "Away" statusKey Changes
New Files:
src/Services/IM/User/UserStatusType.php— String-backed enum for valid status valuessrc/Services/IM/User/Result/UserStatusResult.php— Custom result class withstatus(): stringaccessorsrc/Services/IM/User/Service/UserStatus.php— Service class with four methodstests/Unit/Services/IM/User/Service/UserStatusTest.php— Unit teststests/Integration/Services/IM/User/Service/UserStatusTest.php— Integration testsModified Files:
src/Services/IM/IMServiceBuilder.php— AddeduserStatus()method to expose the servicephpunit.xml.dist— Added integration test suiteMakefile— Added test targetCHANGELOG.md— Documented the new featureUsage Example
Testing
https://claude.ai/code/session_015PC3VWnQepqMPssMpMacy6