/** * @covers ::getNext */ public function testGetNext() { $model1 = new Model(); $model2 = new Model(); $model3 = new Model(); $models = new Models([$model1, $model2, $model3]); $models->getFirst(); $this->assertSame($model2, $models->getNext()); $this->assertSame($model3, $models->getNext()); $this->assertNull($models->getNext()); }
/** * If model doesn't exist, return a void model * * @return AbstractModel */ public function getNext() { return parent::getNext() ?: $this->getRepo()->newVoidModel(); }
/** * Return next model, void model if no model * * @return AbstractModel */ public function getNext() { return $this->current->getNext(); }