public function testFlushReturnsItems() { $transfer = $this->getMockTransfer(); $transfer->expects($this->exactly(2))->method('transfer'); $divisor = $this->getMockDivisor(); $divisor->expects($this->once())->method('createBatches')->will($this->returnValue(array(array('foo', 'baz'), array('bar')))); $batch = new Batch($transfer, $divisor); $batch->add('foo')->add('baz')->add('bar'); $items = $batch->flush(); $this->assertEquals(array('foo', 'baz', 'bar'), $items); }