/** * Get current Job Batch * * @return Batch */ public function getCurrentBatch() { if (!$this->currentBatch->isInApiLimit()) { $this->addNewBatch(); } return $this->currentBatch; }
public function testShoulNotBeInBatchApiLimit() { $batch = new Batch(); $batch->setBatchSizeLimit(4); for ($i = 0; $i < 5; $i++) { $batch->addObject($this->getObjectMock()); } $this->assertFalse($batch->isInApiLimit()); }