diff --git a/src/Messages/DingTalk/MarkdownMessage.php b/src/Messages/DingTalk/MarkdownMessage.php index 9d1adf2d..0db0e9a8 100644 --- a/src/Messages/DingTalk/MarkdownMessage.php +++ b/src/Messages/DingTalk/MarkdownMessage.php @@ -25,7 +25,7 @@ class MarkdownMessage extends Message 'title', 'text', 'atMobiles', - 'atUserIds', + 'atDingtalkIds', 'isAtAll', ]; @@ -34,7 +34,7 @@ class MarkdownMessage extends Message */ protected $allowedTypes = [ 'atMobiles' => ['int', 'string', 'array'], - 'atUserIds' => ['int', 'string', 'array'], + 'atDingtalkIds' => ['int', 'string', 'array'], 'isAtAll' => 'bool', ]; @@ -44,7 +44,7 @@ public function configureOptionsResolver(OptionsResolver $resolver): OptionsReso $resolver->setNormalizer('atMobiles', function (Options $options, $value) { return (array) $value; }); - $resolver->setNormalizer('atUserIds', function (Options $options, $value) { + $resolver->setNormalizer('atDingtalkIds', function (Options $options, $value) { return (array) $value; }); }); diff --git a/src/Messages/DingTalk/TextMessage.php b/src/Messages/DingTalk/TextMessage.php index 08e1a448..e1123b26 100644 --- a/src/Messages/DingTalk/TextMessage.php +++ b/src/Messages/DingTalk/TextMessage.php @@ -24,7 +24,7 @@ class TextMessage extends Message protected $defined = [ 'content', 'atMobiles', - 'atUserIds', + 'atDingtalkIds', 'isAtAll', ]; @@ -33,7 +33,7 @@ class TextMessage extends Message */ protected $allowedTypes = [ 'atMobiles' => ['int', 'string', 'array'], - 'atUserIds' => ['int', 'string', 'array'], + 'atDingtalkIds' => ['int', 'string', 'array'], 'isAtAll' => 'bool', ]; @@ -43,7 +43,7 @@ public function configureOptionsResolver(OptionsResolver $resolver): OptionsReso $resolver->setNormalizer('atMobiles', function (Options $options, $value) { return (array) $value; }); - $resolver->setNormalizer('atUserIds', function (Options $options, $value) { + $resolver->setNormalizer('atDingtalkIds', function (Options $options, $value) { return (array) $value; }); }); diff --git a/tests/Feature/DingTalkTest.php b/tests/Feature/DingTalkTest.php index 40ad47bd..647eb9e2 100644 --- a/tests/Feature/DingTalkTest.php +++ b/tests/Feature/DingTalkTest.php @@ -26,7 +26,7 @@ public function testText() ->setMessage((new \Guanguans\Notify\Messages\DingTalk\TextMessage([ 'content' => 'This is content(keyword).', // 'atMobiles' => [13948484984], - // 'atUserIds' => [123456], + // 'atDingtalkIds' => [123456], // 'isAtAll' => false, ]))) ->send(); @@ -65,7 +65,7 @@ public function testMarkdown() 'title' => 'This is title.', 'text' => '> This is text(keyword).', // 'atMobiles' => [13948484984], - // 'atUserIds' => [123456], + // 'atDingtalkIds' => [123456], // 'isAtAll' => false, ]))) ->send(); diff --git a/tests/Feature/NowPushTest.php b/tests/Feature/NowPushTest.php index 9c791b00..f7f291d0 100644 --- a/tests/Feature/NowPushTest.php +++ b/tests/Feature/NowPushTest.php @@ -18,6 +18,7 @@ class NowPushTest extends TestCase public function testNote() { $this->expectException(\GuzzleHttp\Exception\ClientException::class); + // $this->expectException(\GuzzleHttp\Exception\ServerException::class); Factory::nowPush() ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL') @@ -28,6 +29,7 @@ public function testNote() public function testImage() { $this->expectException(\GuzzleHttp\Exception\ClientException::class); + // $this->expectException(\GuzzleHttp\Exception\ServerException::class); Factory::nowPush() ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL') @@ -38,6 +40,7 @@ public function testImage() public function testLink() { $this->expectException(\GuzzleHttp\Exception\ClientException::class); + // $this->expectException(\GuzzleHttp\Exception\ServerException::class); Factory::nowPush() ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL') @@ -48,6 +51,7 @@ public function testLink() public function testGetUser() { $this->expectException(\GuzzleHttp\Exception\ClientException::class); + // $this->expectException(\GuzzleHttp\Exception\ServerException::class); Factory::nowPush() ->setToken('vpNVue4teSl93ijHBVT6sDT4sHLP7OMTzFCfdQb0QxLYvL')