Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
### Fixed

- Fixed error in arguments in service for method `placement.bind`, [see details](https://github.com/bitrix24/b24phpsdk/issues/151)

- Fixed errors in `task.elapseditem.*` call in ApiClient [see details](https://github.com/bitrix24/b24phpsdk/issues/180)
### Changed

- ❗**️️BC** Changed contract `Bitrix24\SDK\Application\Contracts\Bitrix24Accounts\Entity\Bitrix24AccountInterface`, this change needs to process corner cases
Expand Down
10 changes: 9 additions & 1 deletion src/Core/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,15 @@ public function getResponse(string $apiMethod, array $parameters = []): Response
'task.commentitem.update',
'task.commentitem.getlist',
'task.commentitem.delete',
'task.commentitem.isactionallowed'
'task.commentitem.isactionallowed',
'task.elapseditem.add',
'task.elapseditem.update',
'task.elapseditem.get',
'task.elapseditem.getlist',
'task.elapseditem.delete',
'task.elapseditem.isactionallowed',
'task.elapseditem.getmanifest',
'tasks.task.add',
];
if (!in_array($apiMethod, $strictApiMethods, true)) {
$url .= '?' . $this->requestIdGenerator->getQueryStringParameterName() . '=' . $requestId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ final public function testApplicationUninstalled(
* @throws InvalidArgumentException
*/
#[Test]
#[DataProvider('bitrix24AccountWithStatusNewDataProvider')]
#[DataProvider('bitrix24AccountWithWalidTokenDataProvider')]
#[TestDox('test isApplicationTokenValid method')]
final public function testIsApplicationTokenValid(
Uuid $uuid,
Expand Down Expand Up @@ -531,6 +531,9 @@ final public function testGetUpdatedAt(
int $applicationVersion,
Scope $applicationScope,
string $applicationToken,
int $newApplicationVersion,
Scope $newApplicationScope,
?Throwable $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -681,6 +684,22 @@ final public function testMarkAsActive(
$this->assertEquals($comment, $bitrix24Account->getComment());
}

public static function bitrix24AccountWithWalidTokenDataProvider(): Generator
{
yield 'valid-update' => [
Uuid::v7(),
12345,
true,
true,
'member123',
'https://example.com',
new AuthToken('access_token', 'refresh_token', 1609459200),
1,
new Scope(['crm', 'task']),
'application_token'
];
}

/**
* @throws UnknownScopeCodeException
*/
Expand Down Expand Up @@ -889,4 +908,4 @@ public static function bitrix24AccountDataProvider(): Generator
new Scope(['crm', 'task'])
];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ final public function testSave(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -113,7 +115,9 @@ final public function testDeleteHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -164,7 +168,9 @@ final public function testDeleteNotInDeletedState(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -228,7 +234,9 @@ final public function testFindOneAdminByMemberIdWithHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -266,7 +274,9 @@ final public function testFindOneAdminByMemberIdWithSimpleUser(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -304,7 +314,9 @@ final public function testFindByMemberIdWithHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -365,7 +377,9 @@ final public function testFindByMemberIdWithBlockedAccountHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -409,7 +423,9 @@ final public function testFindByMemberIdWithAccountStatusAccountNotFound(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -451,7 +467,9 @@ final public function testFindByMemberIdWithIsAdminHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -492,7 +510,9 @@ final public function testFindByMemberIdWithIsAdminNotFound(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -529,12 +549,13 @@ final public function testFindByMemberIdWithB24UserIdNotFound(
int $bitrix24UserId,
bool $isBitrix24UserAdmin,
bool $isMasterAccount,

string $memberId,
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -571,12 +592,13 @@ final public function testFindByMemberIdWithAllArgs(
int $bitrix24UserId,
bool $isBitrix24UserAdmin,
bool $isMasterAccount,

string $memberId,
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -622,7 +644,9 @@ final public function testFindByDomainWithHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -683,7 +707,9 @@ final public function testFindByDomainWithBlockedAccountHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -727,7 +753,9 @@ final public function testFindByDomainWithAccountStatusAccountNotFound(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -769,7 +797,9 @@ final public function testFindByDomainWithIsAdminHappyPath(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -810,7 +840,9 @@ final public function testFindByDomainWithIsAdminNotFound(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -851,7 +883,9 @@ final public function testFindByDomainWithAllArgs(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -889,7 +923,9 @@ final public function testFindByApplicationToken(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -940,7 +976,9 @@ final public function testFindByApplicationTokenWithUnknownToken(
string $domainUrl,
AuthToken $authToken,
int $applicationVersion,
Scope $applicationScope
Scope $applicationScope,
string $applicationToken,
?object $throwable
): void {
$bitrix24Account = $this->createBitrix24AccountImplementation(
$uuid,
Expand Down Expand Up @@ -985,4 +1023,4 @@ public static function bitrix24AccountForInstallDataProvider(): Generator
null
];
}
}
}
Loading