public function testSQSAdapterAddMessagesWithSqsException() { $this->mockGenerator->orphanize('__construct'); $this->mockGenerator->shuntParentClassCalls(); $mockSqsClient = new \mock\Aws\Sqs\SqsClient(); $mockQueueUrlModel = new \mock\Guzzle\Service\Resource\Model(); $sqsAdapter = new \ReputationVIP\QueueClient\Adapter\SQSAdapter($mockSqsClient); $this->mockGenerator->orphanize('__construct'); $this->mockGenerator->shuntParentClassCalls(); $sqsException = new \mock\Aws\Sqs\Exception\SqsException(); $mockSqsClient->getMockController()->getQueueUrl = function () use($mockQueueUrlModel) { return $mockQueueUrlModel; }; $mockSqsClient->getMockController()->sendMessageBatch = function () use($sqsException) { throw $sqsException; }; $this->exception(function () use($sqsAdapter) { $sqsAdapter->addMessages('testQueue', array_fill(0, 11, 'test message')); }); }