From 41da8f6aee07d007ff743bb45bdf8c98b5d75fd9 Mon Sep 17 00:00:00 2001 From: "X14XA\\shengli" Date: Tue, 13 May 2025 23:48:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9B=9E=E8=B0=83=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/biz/AppUpdateCallbackRequest.php | 37 ++++++++++++++++++++++++++++ tests/AppManagerTest.php | 14 +++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/biz/AppUpdateCallbackRequest.php diff --git a/src/biz/AppUpdateCallbackRequest.php b/src/biz/AppUpdateCallbackRequest.php new file mode 100644 index 0000000..eafb423 --- /dev/null +++ b/src/biz/AppUpdateCallbackRequest.php @@ -0,0 +1,37 @@ + $this->getUrl() + ]; + } + + + private string $url; + + /** + * @return string + */ + public function getUrl(): string + { + return $this->url; + } + + public function setUrl(string $url): void + { + $this->url = $url; + } +} \ No newline at end of file diff --git a/tests/AppManagerTest.php b/tests/AppManagerTest.php index 7eb02a3..3d13ece 100644 --- a/tests/AppManagerTest.php +++ b/tests/AppManagerTest.php @@ -2,11 +2,13 @@ namespace cn\com\maiyoule\mqttclient\test; +use cn\com\maiyoule\mqttclient\biz\AppUpdateCallbackRequest; use cn\com\maiyoule\mqttclient\biz\AppUserCreateRequest; use cn\com\maiyoule\mqttclient\biz\AppUserDeleteRequest; use cn\com\maiyoule\mqttclient\biz\AppUserUpdateRequest; use cn\com\maiyoule\mqttclient\exception\ApiException; use cn\com\maiyoule\mqttclient\AuthorServerClient; +use GuzzleHttp\Exception\GuzzleException; use PHPUnit\Framework\Assert; use PHPUnit\Framework\TestCase; @@ -80,4 +82,16 @@ class AppManagerTest extends TestCase } } + public function testUpdateAppUrl() + { + $request = new AppUpdateCallbackRequest(); + $request->setUrl('http://202.200.18.46:8000/api.php'); + try { + $biz = $this->manager->exec($request); + $this->assertTrue($biz->isSuccess(), $biz->getMessage()); + } catch (GuzzleException|ApiException $e) { + $this->fail($e->getMessage()); + } + } + }