16 $client1 =
new Client(
'http://www.example.com');
17 $client2 =
new Client(
'http://www.example.com');
19 $commands = array(
new Mc(),
new Mc(),
new Mc(),
new Mc(),
new Mc());
21 $queue = new \SplQueue();
22 foreach ($commands as $i => $command) {
24 $command->setClient($client1);
26 $command->setClient($client2);
32 $this->assertEquals(array(
33 array($commands[0], $commands[2]),
35 array($commands[1], $commands[3])
36 ), $batch->createBatches($queue));
44 $queue = new \SplQueue();
47 $batch->createBatches($queue);
52 $client = $this->getMockBuilder(
'Guzzle\Service\Client')
53 ->setMethods(array(
'send'))
55 $client->expects($this->once())
58 $command->setClient($client);
60 $batch->transfer(array($command));
66 $batch->transfer(array());
75 $client1 =
new Client(
'http://www.example.com');
76 $client2 =
new Client(
'http://www.example.com');
78 $command1->setClient($client1);
80 $command2->setClient($client2);
81 $batch->transfer(array($command1, $command2));