From 6927b383368f0502a2f36bae0d0c8c2a865580b5 Mon Sep 17 00:00:00 2001 From: Vladimir Kolchin Date: Fri, 13 Jan 2023 08:29:11 +0100 Subject: [PATCH 1/2] add system-info method --- lib/RetailCrm/Client/AbstractLoader.php | 15 +++++++++++++++ .../Tests/Methods/CommonMethodsTest.php | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/lib/RetailCrm/Client/AbstractLoader.php b/lib/RetailCrm/Client/AbstractLoader.php index be5128e..c7db224 100755 --- a/lib/RetailCrm/Client/AbstractLoader.php +++ b/lib/RetailCrm/Client/AbstractLoader.php @@ -171,4 +171,19 @@ abstract class AbstractLoader true ); } + + /** + * Returns system version, public and technical urls + * + * @return \RetailCrm\Response\ApiResponse + */ + public function systemInfo() + { + return $this->client->makeRequest( + $this->crmUrl . 'api/system-info', + "GET", + [], + true + ); + } } diff --git a/tests/RetailCrm/Tests/Methods/CommonMethodsTest.php b/tests/RetailCrm/Tests/Methods/CommonMethodsTest.php index 210cbb0..ed13e3b 100755 --- a/tests/RetailCrm/Tests/Methods/CommonMethodsTest.php +++ b/tests/RetailCrm/Tests/Methods/CommonMethodsTest.php @@ -74,4 +74,22 @@ class CommonMethodsTest extends TestCase static::assertTrue($response->isSuccessful()); static::assertGreaterThan(0, count($response['settings'])); } + + /** + * System info + * + * @group api_methods + * + * @return void + */ + public function testSystemInfo() + { + $client = static::getApiClient(); + + $response = $client->request->systemInfo(); + + static::assertEquals(200, $response->getStatusCode()); + static::assertTrue($response->isSuccessful()); + static::assertNotEmpty($response['systemVersion']); + } } From 649c1a38ffa1d0f01ee7ce0748feb40f101beaa5 Mon Sep 17 00:00:00 2001 From: Vladimir Kolchin Date: Fri, 13 Jan 2023 08:36:14 +0100 Subject: [PATCH 2/2] fixed comment --- lib/RetailCrm/Client/AbstractLoader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/RetailCrm/Client/AbstractLoader.php b/lib/RetailCrm/Client/AbstractLoader.php index c7db224..d590b8e 100755 --- a/lib/RetailCrm/Client/AbstractLoader.php +++ b/lib/RetailCrm/Client/AbstractLoader.php @@ -173,7 +173,7 @@ abstract class AbstractLoader } /** - * Returns system version, public and technical urls + * Getting the system version, public and technical urls * * @return \RetailCrm\Response\ApiResponse */