From 6927b383368f0502a2f36bae0d0c8c2a865580b5 Mon Sep 17 00:00:00 2001 From: Vladimir Kolchin Date: Fri, 13 Jan 2023 08:29:11 +0100 Subject: [PATCH] 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']); + } }