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