Skip to content

Commit

Permalink
add test and upgrade library version
Browse files Browse the repository at this point in the history
  • Loading branch information
egrigorev committed Apr 26, 2024
1 parent 48e72fc commit d2c012e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AmoCRM/Client/AmoCRMApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function onAccessTokenRefresh(callable $callback): self
* @param callable $callable
* @return $this
*/
public function onRefreshAccessTokenCallback(callable $callable): self
public function setRefreshAccessTokenCallback(callable $callable): self
{
$this->refreshAccessTokenCallback = $callable;

Expand Down
2 changes: 1 addition & 1 deletion src/AmoCRM/Client/AmoCRMApiRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class AmoCRMApiRequest
public const CONNECT_TIMEOUT = 5;
public const REQUEST_TIMEOUT = 20;
//TODO Do not forget to change this on each release
public const LIBRARY_VERSION = '1.7.2';
public const LIBRARY_VERSION = '1.7.3';
public const USER_AGENT = 'amoCRM-API-Library/' . self::LIBRARY_VERSION;

public const SUCCESS_STATUSES = [
Expand Down
11 changes: 11 additions & 0 deletions tests/Cases/AmoCRM/Client/AmoCRMApiClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,17 @@ public function testOnAccessTokenRefresh()
$this->assertIsCallable($callback);
}

public function testSetOnRefreshAccessTokenCallback()
{
$this->assertInstanceOf(
AmoCRMApiClient::class,
$this->apiClient->setRefreshAccessTokenCallback(function () {
})
);
$callback = $this->_getInnerPropertyValueByReflection('refreshAccessTokenCallback');
$this->assertIsCallable($callback);
}

public function testSetAccountBaseDomain()
{
$this->assertInstanceOf(
Expand Down

0 comments on commit d2c012e

Please sign in to comment.