/** * @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 getFirst() { return parent::getFirst() ?: $this->getRepo()->newVoidModel(); }
/** * If no first, will return void model * * @return AbstractModel */ public function getFirst() { return $this->current->getFirst(); }