File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change 1616class ApiEndPoint
1717{
1818 const PING = 'ping ' ;
19+ const CONFIG = 'config ' ;
1920 const USAGE = 'usage ' ;
2021 const ASSETS = 'resources ' ;
2122 const DERIVED_ASSETS = 'derived_resources ' ;
Original file line number Diff line number Diff line change @@ -53,6 +53,24 @@ public function pingAsync()
5353 return $ this ->apiClient ->getAsync (ApiEndPoint::PING );
5454 }
5555
56+ /**
57+ * Gets account config details.
58+ *
59+ * Fetches the account's configuration details with optional settings.
60+ *
61+ * @param array $options The optional parameters for the API request.
62+ *
63+ * @return ApiResponse
64+ *
65+ * @see https://cloudinary.com/documentation/admin_api#config
66+ */
67+ public function config ($ options = [])
68+ {
69+ $ params = ArrayUtils::whitelist ($ options , ['settings ' ]);
70+
71+ return $ this ->apiClient ->get (ApiEndPoint::CONFIG , $ params );
72+ }
73+
5674 /**
5775 * Gets cloud usage details.
5876 *
Original file line number Diff line number Diff line change 1010
1111namespace Cloudinary \Test \Integration \Admin ;
1212
13+ use Cloudinary \Configuration \Configuration ;
1314use Cloudinary \Test \Integration \IntegrationTestCase ;
1415
1516/**
1617 * Class PingTest
1718 */
18- final class PingTest extends IntegrationTestCase
19+ final class MiscTest extends IntegrationTestCase
1920{
2021 public function testPing ()
2122 {
@@ -30,4 +31,16 @@ public function testPingAsync()
3031
3132 self ::assertEquals ('ok ' , $ result ['status ' ]);
3233 }
34+
35+ public function testConfig ()
36+ {
37+ $ result = self ::$ adminApi ->config ();
38+
39+ self ::assertEquals (Configuration::instance ()->cloud ->cloudName , $ result ['cloud_name ' ]);
40+ self ::assertArrayNotHasKey ('settings ' , $ result );
41+
42+ $ resultWithSettings = self ::$ adminApi ->config (['settings ' => 'true ' ]);
43+
44+ self ::assertArrayHasKey ('settings ' , $ resultWithSettings );
45+ }
3346}
You can’t perform that action at this time.
0 commit comments