diff --git a/src/Bot/Model/Request/BotsRequest.php b/src/Bot/Model/Request/BotsRequest.php index 864b850..3f94194 100644 --- a/src/Bot/Model/Request/BotsRequest.php +++ b/src/Bot/Model/Request/BotsRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class BotsRequest implements ModelInterface { use CommonFields; + use PageLimit; /** * @Type("int") diff --git a/src/Bot/Model/Request/ChannelsRequest.php b/src/Bot/Model/Request/ChannelsRequest.php index 29942e5..97b15d8 100644 --- a/src/Bot/Model/Request/ChannelsRequest.php +++ b/src/Bot/Model/Request/ChannelsRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class ChannelsRequest implements ModelInterface { use CommonFields; + use PageLimit; /** * @Type("array") diff --git a/src/Bot/Model/Request/CustomersRequest.php b/src/Bot/Model/Request/CustomersRequest.php index eefe588..f15c2ea 100644 --- a/src/Bot/Model/Request/CustomersRequest.php +++ b/src/Bot/Model/Request/CustomersRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class CustomersRequest implements ModelInterface { use CommonFields; + use PageLimit; /** * @Type("string") diff --git a/src/Bot/Model/Request/DialogsRequest.php b/src/Bot/Model/Request/DialogsRequest.php index 9233415..f6ac9a5 100644 --- a/src/Bot/Model/Request/DialogsRequest.php +++ b/src/Bot/Model/Request/DialogsRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class DialogsRequest implements ModelInterface { use CommonFields; + use PageLimit; /** * @var int $chatId diff --git a/src/Bot/Model/Request/MembersRequest.php b/src/Bot/Model/Request/MembersRequest.php index dabba66..8b41872 100644 --- a/src/Bot/Model/Request/MembersRequest.php +++ b/src/Bot/Model/Request/MembersRequest.php @@ -22,6 +22,8 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; */ class MembersRequest implements ModelInterface { + use PageLimit; + /** * @var int $chatId * diff --git a/src/Bot/Model/Request/UsersRequest.php b/src/Bot/Model/Request/UsersRequest.php index fc2436e..73d4c3c 100644 --- a/src/Bot/Model/Request/UsersRequest.php +++ b/src/Bot/Model/Request/UsersRequest.php @@ -23,6 +23,7 @@ use RetailCrm\Mg\Bot\Model\ModelInterface; class UsersRequest implements ModelInterface { use CommonFields; + use PageLimit; /** * @Type("string") diff --git a/tests/Bot/Tests/ClientListTest.php b/tests/Bot/Tests/ClientListTest.php index 432683c..4087ac1 100644 --- a/tests/Bot/Tests/ClientListTest.php +++ b/tests/Bot/Tests/ClientListTest.php @@ -10,6 +10,9 @@ namespace RetailCrm\Mg\Bot\Tests; +use Psr\Http\Message\ResponseInterface; +use RetailCrm\Mg\Bot\Client; +use RetailCrm\Mg\Bot\HttpClient; use RetailCrm\Mg\Bot\Model\Constants; use RetailCrm\Mg\Bot\Model\Entity\Channel; use RetailCrm\Mg\Bot\Model\Entity\Chat\Chat; diff --git a/tests/Bot/Tests/Model/ListEntityRequestTest.php b/tests/Bot/Tests/Model/ListEntityRequestTest.php new file mode 100644 index 0000000..28be51e --- /dev/null +++ b/tests/Bot/Tests/Model/ListEntityRequestTest.php @@ -0,0 +1,57 @@ + self::LIMIT]); + $request = new BotsRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new ChannelsRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new ChatsRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new CustomersRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new DialogsRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new MembersRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + + $request = new UsersRequest(); + $request->setLimit(self::LIMIT); + + self::assertEquals($expected, Serializer::serialize($request)); + } +}