Merge branch 'release/1.1.1'
This commit is contained in:
commit
5b84406652
@ -2,7 +2,7 @@
|
||||
"name": "maiyoule/mqttclient_author",
|
||||
"type": "library",
|
||||
"description": "MQTT管理模块操作库",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
|
37
src/biz/AppUpdateCallbackRequest.php
Normal file
37
src/biz/AppUpdateCallbackRequest.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace cn\com\maiyoule\mqttclient\biz;
|
||||
|
||||
use cn\com\maiyoule\mqttclient\IRequest;
|
||||
|
||||
class AppUpdateCallbackRequest extends IRequest
|
||||
{
|
||||
|
||||
public function path(): string
|
||||
{
|
||||
return 'app/callback/update';
|
||||
}
|
||||
|
||||
public function body(): array
|
||||
{
|
||||
return [
|
||||
'url' => $this->getUrl()
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
private string $url;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl(): string
|
||||
{
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
public function setUrl(string $url): void
|
||||
{
|
||||
$this->url = $url;
|
||||
}
|
||||
}
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user