Beispiel #1
0
 /**
  * @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());
 }
Beispiel #2
0
 /**
  * If model doesn't exist, return a void model
  *
  * @return AbstractModel
  */
 public function getNext()
 {
     return parent::getNext() ?: $this->getRepo()->newVoidModel();
 }
Beispiel #3
0
 /**
  * Return next model, void model if no model
  *
  * @return AbstractModel
  */
 public function getNext()
 {
     return $this->current->getNext();
 }