@@ -48,6 +48,47 @@ public function testSQSAdapterAddMessage()
4848 ->class ($ SQSAdapter ->addMessage ('testQueue ' , 'test message ' ))->hasInterface ('\ReputationVIP\QueueClient\Adapter\AdapterInterface ' );
4949 }
5050
51+ public function testSQSAdapterAddMessages ()
52+ {
53+ $ this ->mockGenerator ->orphanize ('__construct ' );
54+ $ this ->mockGenerator ->shuntParentClassCalls ();
55+ $ mockSqsClient = new \mock \Aws \Sqs \SqsClient ;
56+ $ mockQueueUrlModel = new \mock \Guzzle \Service \Resource \Model ;
57+ $ SQSAdapter = new \ReputationVIP \QueueClient \Adapter \SQSAdapter ($ mockSqsClient );
58+
59+ $ mockSqsClient ->getMockController ()->getQueueUrl = function () use ($ mockQueueUrlModel ) {
60+ return $ mockQueueUrlModel ;
61+ };
62+ $ mockSqsClient ->getMockController ()->sendMessageBatch = function () {
63+ };
64+ $ this ->given ($ SQSAdapter )
65+ ->class ($ SQSAdapter ->addMessages ('testQueue ' , array_fill (0 , 11 , 'test message ' )))->hasInterface ('\ReputationVIP\QueueClient\Adapter\AdapterInterface ' );
66+ }
67+
68+ public function testSQSAdapterAddMessagesWithEmptyMessage ()
69+ {
70+ $ this ->mockGenerator ->orphanize ('__construct ' );
71+ $ this ->mockGenerator ->shuntParentClassCalls ();
72+ $ mockSqsClient = new \mock \Aws \Sqs \SqsClient ;
73+ $ SQSAdapter = new \ReputationVIP \QueueClient \Adapter \SQSAdapter ($ mockSqsClient );
74+
75+ $ this ->exception (function () use ($ SQSAdapter ) {
76+ $ SQSAdapter ->addMessages ('testQueue ' , ['test message ' , '' ]);
77+ });
78+ }
79+
80+ public function testSQSAdapterAddMessagesWithEmptyQueueName ()
81+ {
82+ $ this ->mockGenerator ->orphanize ('__construct ' );
83+ $ this ->mockGenerator ->shuntParentClassCalls ();
84+ $ mockSqsClient = new \mock \Aws \Sqs \SqsClient ;
85+ $ SQSAdapter = new \ReputationVIP \QueueClient \Adapter \SQSAdapter ($ mockSqsClient );
86+
87+ $ this ->exception (function () use ($ SQSAdapter ) {
88+ $ SQSAdapter ->addMessages ('' , ['' ]);
89+ });
90+ }
91+
5192 public function testSQSAdapterGetMessagesWithEmptyQueueName ()
5293 {
5394 $ this ->mockGenerator ->orphanize ('__construct ' );
0 commit comments