diff --git a/composer.json b/composer.json index 50a9fbc..9a40949 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "maiyoule/mqttclient_author", "type": "library", "description": "MQTT管理模块操作库", - "version": "1.1.0", + "version": "1.1.1", "license": "MIT", "authors": [ { 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()); + } + } + }