15 $t = $this->getMock(
'Guzzle\Batch\BatchTransferInterface', array(
'transfer'));
16 $d = $this->getMock(
'Guzzle\Batch\BatchDivisorInterface', array(
'createBatches'));
18 $batch =
new Batch($t, $d);
19 $queue = $this->readAttribute($batch,
'queue');
21 $d->expects($this->exactly(2))
22 ->method(
'createBatches')
23 ->will($this->returnCallback(
function () use ($queue) {
25 foreach ($queue as $item) {
31 $t->expects($this->exactly(2))
35 $this->assertEquals(3, $flush->getThreshold());
36 $flush->setThreshold(2);
37 $flush->add(
'foo')->add(
'baz')->add(
'bar')->add(
'bee')->add(
'boo');
38 $this->assertEquals(1, count($flush));