diff --git a/src/Bot/Model/Entity/Channel/ChannelSettings.php b/src/Bot/Model/Entity/Channel/ChannelSettings.php index 06d3f3b..d2954d0 100644 --- a/src/Bot/Model/Entity/Channel/ChannelSettings.php +++ b/src/Bot/Model/Entity/Channel/ChannelSettings.php @@ -83,6 +83,15 @@ class ChannelSettings implements ModelInterface */ private $file; + /** + * @var ChannelSettingsSuggestions $suggestions + * + * @Type("RetailCrm\Mg\Bot\Model\Entity\Channel\ChannelSettingsSuggestions") + * @Accessor(getter="getSuggestions",setter="setSuggestions") + * @SkipWhenEmpty() + */ + private $suggestions; + /** * @return ChannelSettingsStatus|null */ @@ -194,4 +203,20 @@ public function setFile(ChannelSettingsItem $file) { $this->file = $file; } + + /** + * @return ChannelSettingsSuggestions|null + */ + public function getSuggestions(): ?ChannelSettingsSuggestions + { + return $this->suggestions; + } + + /** + * @param ChannelSettingsSuggestions $suggestions + */ + public function setSuggestions(ChannelSettingsSuggestions $suggestions): void + { + $this->suggestions = $suggestions; + } } diff --git a/src/Bot/Model/Entity/Channel/ChannelSettingsSuggestions.php b/src/Bot/Model/Entity/Channel/ChannelSettingsSuggestions.php new file mode 100644 index 0000000..6f1406a --- /dev/null +++ b/src/Bot/Model/Entity/Channel/ChannelSettingsSuggestions.php @@ -0,0 +1,100 @@ +email; + } + + /** + * @param string $email + */ + public function setEmail(string $email): void + { + $this->email = $email; + } + + /** + * @return string|null + */ + public function getPhone(): ?string + { + return $this->phone; + } + + /** + * @param string $phone + */ + public function setPhone(string $phone): void + { + $this->phone = $phone; + } + + /** + * @return string|null + */ + public function getText(): ?string + { + return $this->text; + } + + /** + * @param string $text + */ + public function setText(string $text): void + { + $this->text = $text; + } +} diff --git a/tests/Bot/Tests/ClientListTest.php b/tests/Bot/Tests/ClientListTest.php index 2a8937e..94694f3 100644 --- a/tests/Bot/Tests/ClientListTest.php +++ b/tests/Bot/Tests/ClientListTest.php @@ -54,6 +54,9 @@ public function testChannels() static::assertCount(5, $response, "Incorrect channels count"); static::assertInstanceOf(Channel\Channel::class, $response[0], "Incorrect channel instance"); + + $textSuggestions = $response[0]->getSettings()->getSuggestions()->getText(); + static::assertStringContainsString("both", $textSuggestions, "Incorrect text suggestions"); } /** diff --git a/tests/Resources/channels.json b/tests/Resources/channels.json index 1e2f339..55ae4a4 100644 --- a/tests/Resources/channels.json +++ b/tests/Resources/channels.json @@ -35,6 +35,11 @@ "quoting": "both", "deleting": "receive", "max_items_count": 1 + }, + "suggestions": { + "text": "both", + "email": "both", + "phone": "both" } }, "created_at": "2019-06-11T12:46:48.72241Z", @@ -79,6 +84,11 @@ "quoting": "both", "deleting": "receive", "max_items_count": 1 + }, + "suggestions": { + "text": "both", + "email": "both", + "phone": "both" } }, "created_at": "2019-06-11T12:41:44.660495Z", @@ -123,6 +133,11 @@ "quoting": "both", "deleting": "receive", "max_items_count": 1 + }, + "suggestions": { + "text": "both", + "email": "both", + "phone": "both" } }, "created_at": "2019-06-11T12:38:24.322413Z", @@ -167,6 +182,11 @@ "quoting": "both", "deleting": "receive", "max_items_count": 1 + }, + "suggestions": { + "text": "both", + "email": "both", + "phone": "both" } }, "created_at": "2019-06-11T12:33:08.676214Z", @@ -211,6 +231,11 @@ "quoting": "both", "deleting": "receive", "max_items_count": 1 + }, + "suggestions": { + "text": "both", + "email": "both", + "phone": "both" } }, "created_at": "2019-06-11T12:33:08Z",