public function testSQSAdapterCreateQueueWithSqsException() { $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()->createQueue = function () use($sqsException) { throw $sqsException; }; $this->exception(function () use($sqsAdapter) { $sqsAdapter->createQueue('testQueue'); }); }
public function testSQSAdapterCreateQueueWithEmptyQueueName() { $this->mockGenerator->orphanize('__construct'); $this->mockGenerator->shuntParentClassCalls(); $mockSqsClient = new \mock\Aws\Sqs\SqsClient(); $SQSAdapter = new \ReputationVIP\QueueClient\Adapter\SQSAdapter($mockSqsClient); $this->exception(function () use($SQSAdapter) { $SQSAdapter->createQueue(''); }); }