Conditions | 1 |
Paths | 1 |
Total Lines | 28 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | public function キュー一覧を取得するコマンドを実行する() |
||
15 | { |
||
16 | $client = Phake::mock('Aws\Sqs\SqsClient'); |
||
17 | $container = Phake::mock('Symfony\Component\DependencyInjection\Container'); |
||
18 | |||
19 | Phake::when($container)->get('sqs_job_queue.client')->thenReturn($client); |
||
20 | Phake::when($client)->listQueues($this->isType('array')) |
||
21 | ->thenReturn(array( |
||
22 | 'QueueUrls' => array('/path/to/url'), |
||
23 | )); |
||
24 | |||
25 | $application = new Application(); |
||
26 | $application->add(new QueueListCommand()); |
||
27 | |||
28 | $command = $application->get('sqs_job_queue:queue-list'); |
||
29 | $command->setContainer($container); |
||
30 | |||
31 | $tester = new CommandTester($command); |
||
32 | $tester->execute(array( |
||
33 | 'command' => $command->getName(), |
||
34 | '--queueNamePrefix' => 'test' |
||
35 | )); |
||
36 | |||
37 | Phake::verify($container)->get('sqs_job_queue.client'); |
||
38 | Phake::verify($client)->listQueues(array( |
||
39 | 'QueueNamePrefix' => 'test' |
||
40 | )); |
||
41 | } |
||
42 | } |